Multitouch control for characters in Android.

I am creating a 2D platformer game in GDevelop. Everything was all right until I exported the game to Android. I realized that there was no keyboard and mouse attached to a Android device to control the player (So foolish of me for not realizing it sooner)!
Anyway, I added some new sprites to act as the keyboard arrow keys. Now the problem is that you could press multiple arrow keys in the same time to control the character with a keyboard(for example you could press the right and up arrow keys to make the character jump and move right at the same time!).
Now how can I add that feature to my sprites too? Please help!

You have to enable the multitouch thing (the action is called “De/activate moving mouse cursor with touches”), and manage the touches, check the Web Platformer template (template, not example), it uses multitouch :slight_smile:

I have already managed the touches for the individual sprites. Will GDevelop add multitouch control to the sprites automatically if I add the action you mentioned at the beginning of the scene?

Yes, in theory, but when you enable it, instead checking “mouse over sprite” + “mouse button pressed” to launch the actions when the sprite is clicked, you just have to test “mouse over sprite”, as in the template (because if the mouse is over the sprite it means you are doing a touch on it) :slight_smile:

yes but it keeps on touching the button even after you stop touching it… it’s not working in GD 5 :confused:

People help me do somethin i try it too i made my keyboard for android to type name or other stuff like this…And its have show option on pc and android…i was test this in old and new phones and iphon and its work for me. and ther is option to wright text to global variable call “name”.The new phones with resolution grater then 800x600 needs bigger buttons.



That is because the touch change the position of the cursor and when you stop the touch the cursor still remain in position so the condition “The cursor/touch is on sprite” will be always true because the cursor is still on the sprite even though you no longer touch it.

The solution is to set the touch not to move the cursor
touch.png