Ask here your questions to get help using GDevelop.
User avatar
By gnerpo
#56979 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? :?

touch-problem.png
touch-problem.png (29.01 KiB) Viewed 1918 times
User avatar
By Jubeliuksen3
#56994 I don't know is this working or helping anything but check the example "Multitouch.gdg" in GDevelop example folder.
User avatar
By victor
#56995 Hi,

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).
User avatar
By gnerpo
#56996
victor wrote:Hi,

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...!
User avatar
By victor
#56998 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.
User avatar
By gnerpo
#56999
victor wrote: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! :)