Attack (Button) Spam Prevention

So I have a boolean set up to prevent someone to spam an attack, but if really press that button a lot of times, it eventually sets the boolean to true and never gets out of there (and won’t let me do anything in the process), how could I prevent that?

Setting the variable to true after checking if it’s already true:

Setting the variable to false after the chain in an animation is passed through:

True forever, where it won’t let me do anything:

If your int is greater than 2, it won’t reset isAttacking.

Only lead I have right now.

I suggest you try to look for information about ‘State Machine’ though.

What int? The combo? Set Attacking to false is connected in every animation (the 3 that exist).

If all reset the attack state, try putting it before the “SwitchOnInt” or use a sequence node to put it after the first sequence (SwitchOnInt) has finished. In that case you’re sure it resets.

At least try, it’s the only lead you got apparently.

The first option gives better results than what I had before, I can still trigger it to stay “true” if I really spam it, but I think that’s something I can fix in the future, thanks.

Did you ever fix this? I’m having the exact same issue you were having