Drag and drop ? code return x,y by tween

I have an obj_puzzle_holder object that contains pieces

I want it back in place if it isn’t put in the right place
There are places to which toys pull pieces
The piece is returned to its place
I want code return x,y by tween ??

You need:

  1. add Tween behavior to the object;
  2. remember the starting coordinates;
  3. if the object is not placed in the cell, then start the animation.

This post had a similar question, and this is a link to my solution. Only the condition Card count = 1 is applicable. and instead of just setting the X & Y co-ordinates, use them in a positional tween

1 Like


not set ?

You check that the obj_puzzle_piece object has no drag and drop behavior enabled and you are not moving it. I suppose you need to change the check that the behavior is activated.
Sorry, I corrected the message when I saw a similar error.

Difficult for each piece?

My example for one object:

In the post from @MrMen there is a solution for several objects. They are assigned an identifier, with which you work.

1 Like


many thanks (^_^)

The random distribution of the pieces remains ??
If I have 5 piece

1 Like