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?
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?
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).
Thank you for the help!