Hi, thanks for the reply.
[quote:l4zhz8c9]I'm not sure how your game works and where do you get values for TargetX, TargetY.
I have 2 objects for each set of events 1. The draggable and 2. The drop area (which is a duplicate of the draggable with opacity set to 0).
So, like this, I have around 13 dragables and 13 drop areas.
I set the XY position by seeing the XY position of the drop area object.
i.e. if the object is dragged and it overlaps the drop area then it snaps to the XY position of the drop area, if not, then goes back to its original point.
[quote:l4zhz8c9]If you have to repeat the same event more than twice, you should definitely optimize it.
Add all sprites to a family, define Drag&Drop behaviour on the family. You'll be able to keep just one event "Family on Drop" and remove all duplicates!
Add instance variables to the family: StartX, StartY, TargetX, TargetY
On Start of the Layout (or On Family Created) set StartX to Family.x, set StartY to Family.y
[quote:l4zhz8c9]On Drop - if dropped on a wrong spot, set object position to (self.StartX, self.StartY)
If dropped correctly, set object position to (self.TargetX, self.TargetY)
Sorry, I didn't get these. I humbly request a screenshot or .capx.