(SOLVED)Disableing multi-touch

Hi everyone,

I searched the forum quite a lot, but I couldn’t find a clear answer to my issue.

I created a game that works great on desktop, but on a phone or tablet the game sometimes breaks when the player touches the screen with multiple fingers at the same time, or accidentally touches the screen with their whole hand.

This does not happen consistently, but it happens often enough to be a real problem. I tried using boolean variables to block input and ignore extra clicks, but none of these solutions fully fixed the issue.

It is important to mention that I cannot reproduce the bug with a mouse, and I also cannot reproduce it when using only one finger. The issue only happens when the game receives input from multiple fingers at the same time.

Is there a way in GDevelop to completely disable multi-touch input, or force the game to only accept one touch at a time?

I would prefer a global solution if possible, because changing all my input logic to use Touch IDs would require a lot of work.

Any advice would be greatly appreciated. Thanks!

The only ways around it that I’ve used is either using the pick nearest object condition after a touch or instead of touch use the point is inside an object using the cursor x, y. Although, that approach might still need a pick the nearest object condition if the objects can overlap.

You might also need the events to be subevents of the touch event, so they all use the same object. Check for the touch just once.

its working!
cant explain why but this did the trick!
thank you very much :heart: :heart:

I am attaching the picture to be used in case anyone else encounters this problem.

It’s similar to using closest to CursorX() and CursorY() the difference is it will choose the picked object created first bc that’s the X, Y that it will use for the pick nearest.

Pick nearest will always pick just 1 object.

Great
Thanks for the clarification :smiling_face: