I have an attack bind to the space bar, and I figured out how to stop the attack animation from spamming but how do I stop the attack hitbox from spam spawning, or better said how do I make it spawn once and then make another appear after the first one dissappears?
You can lock out using a variable, space pressed if variable=0, then on action set variable to 1. You can switch variable back to 0 on hit box destroyed condition or on a timer.
I did that, but when I put after the timer to set variable back to 0, it leaves me back to step one, it still spams the hitbox spawning.
Share the event screenshot if you can. Really it should loop when you press the button if set variable to 1 is on the actions.
I fixed it, I just needed to make a sub-event in which if 1 = Number, it chnges the variable to 0 after some time.
Develop games in your browser. Powerful, performant & highly capable.
I highly recommend using the timer behavior for cooldowns.
On space pressed and
If timer is not running -> do thing, start timer.
You can also stop/interrupt the timer with another trigger if you want as well.