Lets say I drag and drop an object but it's overlapping the same object, how would I get the object to return to the original position from drag start.
if its not overlapping another object it drops
Add two instance variables startX and startY. On start of the layout or when the object is created set startX to object.x, startY to object.y
When you need to return the object to initial position, set its position to (self.startX, self.startY)
Add two instance variables startX and startY. On start of the layout or when the object is created set startX to object.x, startY to object.y When you need to return the object to initial position, set its position to (self.startX, self.startY)
I did that actually can you take a look at my capX, please?
dropbox.com/s/bh60trqot6zpyla/itextinv.capx
am i doing something wrong here?
Develop games in your browser. Powerful, performant & highly capable.
press E to pick up item.
Now when drag and drop item to slot with item already in it, I want it to return to the original slot
You can't test item overlapping with another item, because "Item On drop" event picks just one instance of item object. You need to create a family, add Item object into it and do this:
Very cool man thanks!