Draggable elements: draggable upon another draggable

Hi again guys!

I have made something with 2 draggable objects. You can see here: https://s3-eu-west-1.amazonaws.com/gd-games/game-93899274-b6f3-4f9a-b46f-b63341e40a36/index.html

The draggable objects are the Multimeter and the Red Probe.

The Red Probe is Z=4, and the Multimeter is Z=1. So, when we put the probe upon the multimeter, it continues showing.

But in this condition (Red Probe Upon the Multimeter), when I click in Red Probe, the Multimeter is who moves!

I could find a solution: check if the cursor/touch is upon the red probe. If yes, than disable the draggable behavior in Multimeter. If not, than enable draggable behavior in Multimeter. See below:

*I did not put this solution on the link above.

Is this a bug of GDevelop? Or there is something else?

Thank you guys! You are amazing!

Hi there!
Yes, it could be a bug/design flaw, that like in web pages, if multiple buttons/elements are on top of each other, the user can interact with only the top element.
It’s good that you managed to solve it, even though I’m not sure how it works.

1 Like

Will this bug be fixed? It is very annoying having to correct this in all objects created!

Can you share that example project linked above?

Yes, but you can test easily:

Steps to reproduce the behavior:

  1. Creat two sprites
  2. Put Images in both
  3. Add the Behavior “Draggable” in both
  4. Put one upon the other.
  5. Then, try to drag this object. The object that is draged is the other.

I posted this issue in the GitHub: Bug with draggable objects · Issue #1675 · 4ian/GDevelop · GitHub