Multitouch Click

I am using multitouch in a mobile simulation I’m creating. The user has to hold down one button, then click a second button to get a sprite to move. The first click registers just fine, but to get the second button click (so the sprite moves) the button has to be hit twice before it’s registered. I have a picture of the code attached. Mind you, I had it written much more simply but this was part of my debugging process. I don’t see why this wouldn’t work, though. Any suggestions?


Try something like:

The cursor/touch is on HomeButton // Change scene to Welcome

The cursor/touch is on TableButtonSimple // Set variable Pressed to true
[INVERT] The cursor/touch is on TableButtonSimple // Set variable Pressed to false

The value of Pressed is true
[sub condition] The cursor/touch is on LeftArrowButton // your actions
[sub condition] The cursor/touch is on RightArrowButton // your actions

Thanks for the help! I actually figured it out right after posting, haha. It was some issue with where the ‘Trigger Once’ lived. Once I swapped the order of “the cursor/touch is on…” with “Touch or Left mouse button is down / Trigger Once” it worked as expected!

You’re not using multi touch in your events. You’ve coded it for single mouse/touch control, which is why you’re having to set variables to flag that a button has been pressed. It may be working for the scenario you have now, but it’s the wrong way to go about doing it and won’t work for true multi touch requirements.

To use multi touch, you need to get the touch id to check the position & status of each touch.

Have look into the GDevelop multitouch example for a better understanding. And ask on the forum if you have any questions about it.

1 Like

That’s super helpful, thank you so much! Figured there was probably a more sophisticated answer but am new to GDevelop and hadn’t found it!