[SOLVED] Mouse button just pressed and not held

I’ve been making a game and with the current mouse button down action, it allows me to hold down the left mouse button and hover over a button and it does the buttons action. For example, in the menu there is a “Quit” Button, and the way I intend it work is you have to have your mouse over it to click. So I add

The cursor/touch is on an object

Touch or Left mouse button is down

but the way the touch is setup is I can click and hold off the quit button, and just hover over it and it will still do the actions.

Any way I could fix this?

If I understood your problem correctly I think you can solve it doing this:

Take care if you are using this scene for more things to that events don’t conflict to any other thing…

The action “delete button quit” is just for the test.


Hi, Rasterisko’s suggestion obviously works fine. An alternative - depending on what you actually want to do - could be to use the ‘Mouse button released’ condition instead of ‘Mouse button pressed’.

1 Like

This works! Thanks a lot.

It does, but in my opinion it doesn’t feel as smooth as pressed.

I’m a bit confused on the need to go this complex here. Just use “Trigger once” in the conditions with mouse button down, and it’ll only count the first click/tap.

I think the problem was: clicking away from the button, but holding that click and dragging it to the button will activate the button. And he doesn’t want that.

Ahh, That probably needs a toggle switch variable to fully fix, but your timer solution now makes sense and should be fine.

1 Like