Mobile controls

Hello, I have been trying to put mobile controls on my game, but there’s an issue that I can’t seem to figure out.

Down below you can see a screenshot of my game, it’s a top-down wave defence game, I wanna make it so you can move using the joystick on the bottom left, and if you press anywhere else in the screen you can shoot.

My issue is that when I try to move and shoot at the same time, the game starts fighting over where the cursor should be, and the gun angle gets messed up.

Now I already know about the “deactivate moving mouse cursor with touches” action, which does fix the issue, but then I can no longer angle the gun where I touch. I use the action angle object towards cursorX(),cusorY(), and I tried other actions but I never got it to work.

If anyone knows a solution, I would really appreciate the help.

Can you show your events?

without seeing your actions, you should read up on the multitouch feature of gdevelop, which is for this exact reason…

In your case however, you could easily just add two sprite objects with a rectangular sprite like this…


That way, when you touch the left rectangle, you can move the player on that mouse x,y and on the right you shoot…

Hope it helps…

De/activate moving the mouse with touches
You find that action put it to event with condition with for example at beginning of scene
And set it to NO
And you enjoy

Sorry only now i did read other half of your post
So basically what you need is learn to use touch IDs you will figure out from this topic

And then you need to simply check if any touch which start is made on some button (so basically you invert condition)
And since it was not THAT is your event for setting angle of gun to your touch

Sorry for the late reply.
Here are the events for the gun angle

I have it set up so that you can only shoot when the orange area is being pressed

Thank you for the reply but I already have something similar set up.

But it still doesn’t work, maybe I have it wrong or something with the events here

Have you already saw these videos?

Minute 17

Yes, I saw like 6 mobile controls tutorials, and none of them had anything to solve it

I should try to recreate you system to give you a good solution, I don’t work on mobile to much, but my last game use mobile controls and i can move two joystick at same time.

Yeah, I already know about that, but I am not a big fan of it, especially in my game I don’t think having 2 joysticks is a good idea.