Problem creating touch controls for mobile platform game


Hi all,
i’ve created simple controls for a touch platform game. When i touch and hold left/right and then jump the player jump left/right. But when i release the jump, still holding the right/left control, the player stops moving…why? :confused:



I don’t know is this working or helping anything but check the example “Multitouch.gdg” in GDevelop example folder.



The “Touch or Left mouse button is down” only works with single touch. So, when you release one finger, the condition stops from being true and your player stops moving. Just remove this condition (from all the events) and it will work (“Cursor/touch is on XXX” already tests if the touch is on one object, with multitouch support).


Thanks Victor, but removing “Touch or Left mouse button is down” the action never stops. For example if i press left and put the finger off the screen the player continues moving in that direction…!



I have the same problem…


I forgot that you also need to disable the “moving cursor with touch” feature to allow the multitouch to work. This can be achieved by adding the “deactivate moving mouse cursor with touches” (“Mouse and touch” category) at the beginning of the scene.

You can see an example of touch controls by creating a new project with the “HTML5 > Platformer” template.


Great! Thank you very very much! :slight_smile:


Thank you so much​:heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart::heart: