Does GDevelop have multitouch funcitonality or not?

I see that it was apparently added in 2015. However, I don’t see it when I try games on my phone. Hitting a second button negates the first button that is being pressed (two things cant be done with touch at the same time).

I mostly want to know so I can know if there’s any point making 2-players on GDevelop. I really like and appreciate the project, and I’m not going to delete it or anything - just I’ll try to do things on it that are possible. Currently, I have two games going, neither of which works on my mobile simply because I can’t do multitouch (to have two players shoot at each other at the same time; and to have two players moving with faux controls on the same screen)

yes it has. There is a multitouch example
But is has its partícular way to go. on each loop, First you create an object at the coordinates where the user pressed for every touch and at the end of loop you procces all this objects and do your things

1 Like

Take a look here: Jukade - minigames for two by Gruk
I used the multitouch example for all of them. :blush:

2 Likes

OK great thanks. @Gruk yes I see what you mean, in the games (nice work btw!) where you turn players, you can turn one constantly, and while he’s turning, turn the other player, which I can’t do on my games yet).

I had tried to implement this as it is in the documentation Mouse and handling touch events [GDevelop wiki] but it didn’t work for me, which is why I was thinking it wasn’t working yet. Is this the same way you’re doing it (on the linked page, its the bottom example with the screenshot of the conditions/actions)?

The example on that page works on my phone, actually, so I must have done something wrong! I earlier thought it didn’t work on my phone either, but it does! EDIT: I tried again, and it doesn’t :frowning:

Well, I tried it again, and I’m not getting results again, when I add that example code (from the link) to my project.

What I did:

  • Added the same content to the bottom of my ‘events’ sheet
  • Created a sprite called ‘Marker’ and gave it an object variable of ‘TouchId’ with 0.
  • launched a preview live

But I don’t have multitouch (or rather I do, but it doesn’t really work right). It does create the marker in at 0 0. But, for example, if I hold down jump (multi jump is enabled btw) my player goes up up up (great) (I should note they’re able to multijump). I press jump for p2 (he starts going up, too. great). I release p2 jump (and both start falling - not what I want!). I press p2 jump again (so both are pressed because p1jump is already held down), and both start going up again. Release one of their ‘jump’ buttons, both start falling again. Same goes for trying to use the direction buttons - when the second button is pressed while the first is still depressed, it sort of links them so releasing either one does the same action to both, or something

Does anyone know what I might be doing wrong? Here are screenshots:

All your touch actions need to be inside a for each event for the multitouch to work, and Marker.X/Y is what you need to use in the conditions, instead of “touch/cursor”.
Here’s an example from my minigame “Eskiv”:

Ok, I tried working with this idea, but Im not sure what exactly you mean by put each action in a ‘for each’ event.

I modified my code like this (isolating just jump buttons for the moment):

But the jump buttons dont do anything now

Here are “for each” events: For Each events [GDevelop wiki]