Shooting problem that does not stop [RESOLVED]

Hello, I have a problem. I’m doing a little shoot’em up I managed to get my ship to fire projectiles (without the Firebullet behavior) the problem is that if the ship is stationary and you press on the button of fire then that one slackens it then the ship continues to fire all alone, it stops only if one touches another place of the screen instead of the button of fire. So I’ve already tried a lot of conditions so that once the fire button is released and the ship is stationary there is no more fire, but I can’t. I hope you can help me thank you.

Here the link of my game : https://game-previews.gdevelop.io/1684145095218-974197/index.html

And events :

When you touch the screen, the cursor moves to where you touched, When you stop touching, the cursor doesn’t move, but stays at the position of that last touch.

If you touch on the button, the cursor will move there and stay. And so any check for cursor over button will continually be true.

One way around this is to check that a new touch has started and that the cursor is on the button. That should fix your issue.

1 Like

Hello, I apologize, but the link you provided does not contain a solution to the problem. I also searched for other resources, but couldn’t find the same issue. Two years ago, a moderator advised me not to create duplicate posts, which is why I only responded here. I’m sorry if I made a mistake, but I have the same problem as Tibs. The problem occurs when I open the app and touch the loading screen. The coordinates of that touch are permanently stored when multitouch is enabled. I need assistance in resolving this issue. Can you please explain how a multitouch event can help solve this problem? Thank you

the solution is simple, at the beginning of the scene you have to put the action “move the mouse cursor during a touch key on no” so the mouse cursor is not used even on a touch screen.

No, that won’t work. For instance, let’s imagine you have designed the entire screen to function as a button, and you have a substantial project that takes approximately 10 seconds to load before transitioning to the first scene. During those initial 10 seconds of loading, if you happen to click anywhere on the screen, the cursor will move to that location, despite the fact that the command “Move mouse cursor when touching screen = no” is intended to prevent this. Then that button will be triggered if there is an event that if the cursor is there then = action

I believe the reason behind this issue is that the screen is still in the process of loading, and therefore, the instruction “Move mouse cursor when touching screen = no” has not yet been executed. As a result, the cursor becomes stuck wherever you clicked on the screen.

I don’t know if this is a bug or it’s just only few people encounter it. Give it a try base on what I said to prove it.

yes you are right, I just tested by pressing while loading and my bug came back too. Maybe in this case you have to make a scene with the action to deactivate the cursor on the intro scene and like that when you arrive in the game scene then there is no longer a problem. I would test.

Did you ever find a solution to this?

I have the same issue that if you touch the loading screen GDevelop seems to remember that touch. I’ve tried disabling mouse cursor and cursor movement, but it makes no difference - it remembers that damned touch!!!