Hi guys,
I always seem to have this problem, when I press a button to go to the next scene, the press carry’s on to the next scene/button, so I cannot have 2 buttons in the same place or it will create a loop.
Any ideas please, I am only using mobile, no mouse or keyboard.
I have tried this:
When using touch controls, I use these events, creating a little marker object. (8x8, 16x16).
To activate the controls, you check if the marker is colliding with MaleVoice, FemaleVoice… and before changing the scene, you can delete the all the marker objects.
Theorically, since a new touch hasn’t started (You haven’t touch the screen again), the object will not be created again, and the control will not be activated, even if the finger is keep touching the screen.
I think it isn’t a big change in your events’ scheet and could be worth the try.
Use a global boolean variable to indicate the touch has bee processed. Set it to true if those events of your first post , and set it to false if no touch is detected. Then only process the button action if that global variable is false.
What MrMen is describing above is a Toggle switch variable. It is very common in game dev, and is a requirement in GDevelop if you’re using the same button across multiple actions or scenes and don’t want them to trigger rapidly.
You can see some examples of this in Not-a-vania, an example included with the engine, although it is used with gamepad/key pressed.