Help limiting button presses

So I have put together a dash function for my character. the problem is it can be spammed, is there a way a button can only take input once every few seconds?

This is basically similar to weapon fire intervals and reload times. You can either run your chain through a gate that opens and closes based on a delay, or for the case of weapons, i’ll set up a bool bReloaded. when the weapon fires, bReloaded is set to false, and after a delay equal to the assigned variable reloadTime, the bool is set to true, in which case the streamed input triggers again. instead of a bool called bReloaded, you could have something like bDashRecharged or something to help describe the bool.

Hi SnackDragon,
I wrote a simple function for you, which actually does what you want.
I did my best to comment everything, but if you have a question feel free to ask.
Just replace the PrintString() with your code you want to be limited by time.
Also set the default of “Time to Wait” to the value (in seconds) the player has to wait between inputs.
Drop is just the Input Event

1 Like

That works perfectly. Thank you so much!

I know I chose the other answer because it did what i needed to quickly, but I was hoping you could make a small example for me for future reference?

sure.

the answer from potatojo above is good too (and probably better), but you may want to consolidate that graph into a function that returns true or false so you can always grab the state of the dash when other character actions will be limited because the character is in a dash state.

Thank you so much :heavy_check_mark:

You helped me with something totally unrelated, but the nodes worked perfectly!

Thank you so much! This worked like a charm!