Enabling imagesprite

Hi everyone,
I'm trying to build an app for setting a dinner table.
I have a canvas and a set of images sprite representing utensils (fork, spoon, knife, plate and so on).
The images are sparse in the table, the user has to set the table by correctly placing the utensil in a drop table.
When the user picks and places an utensil in the table, and he drops upper the other ones, all the touched utensils drop. For avoiding that, I set the enabled field of no dragged utensil to false, and when the user touches up the dragged utensil, the enabled fields of the other ones return to true.
But it does not work!
When utensils collide, something crashes, and I do not know why! I attach a demo of the error.
In the demo, the spoon collides to the plate, and the app crashes (all remain blocked).
WhatsApp Video 2021-02-22 at 21.48.43|video
The simple code is

What's happened?

This looks like sprite cannibalism.

To insure only one sprite gets dragged at a time, set aside a global variable to hold the current sprite component that is being dragged, and set it on sprite touchdown. In all dragged events, insure that only the sprite recorded in the global variable moves. Reset the global variable on touchUp.

Sampe app:

Tks a lot for your answer!
I will try it!

You are a genius!
Now it works!!
Tks very much!
Can I ask you if there is a method for ordering the images? For example, for setting that the plate has to stay above the other utensils?
Thank you!

The Z attribute of the sprite controls how high above the canvas it appears, in front or behind the other sprites. I haven't used it much.

Also pay attention to your sprite sizes, if you get trouble grabbing things.

1 Like

Have you some suggestions about the size of the picture in the imagesprite?
In the design view the size seems good, but when I simulate the app in my companion, the size changes and the utensils look bad.
Tks a lot!

I don't work much with image files.

Here's some accumulated wisdom, until more experienced users can chime in ..