Does GDevelop have multitouch funcitonality or not?


#1

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)


#2

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


#3

Take a look here: https://gruk.itch.io/jukade
I used the multitouch example for all of them. :blush:


#4

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 http://wiki.compilgames.net/doku.php/gdevelop5/all-features/mouse-touch 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:


#5

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:


#6

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”:


#7

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


#8

Here are “for each” events: http://wiki.compilgames.net/doku.php/gdevelop5/events/foreach