Button clicked event firing multiple times

The button clicked event is firing multiple times, once the button is clicked, this is giving me problems

Is there a way to prevent this from happening? so it doesn’t fire the same event multiple times, when i single button is clicked?

1 Like

Hi @gumegasonic!

As long as you don’t click the button multiply times I expect the event is fired once. Curious if the click event is fired every frame as long as the mouse button is down. If that’s the case you can try to use the mouseup event.

Maybe you can use .once instead of .on. Useful if you use the button for example to change the scene. Alternatively you can use a boolean to prevent the button can clicked repeatedly. (You need to reset the boolean at the point you want to make to button work again).

2 Likes

Thank you for the help!

1 Like