How to stop different inputs from triggering each other?

Hi, so I have a dash setup where you need to double tap a key (W,A,S,D) to dash into that direction.

The double tapping is working fine, but combining different inputs is also activating the dash. For example; I press forward once and then right once, it dashes to the right. Press back once and then left once, it dashes to the left.

I wanted to ask how to stop this? I assume it’s something simple I need to change in the blueprint, but being new I’m a bit overwhelmed.

Would appreciate any help, thanks.

I’d make an integer variable and anytime WASD is pressed the variable is set to 1,2,3, or 4, representing each key. Before it sets the number it would check to see if it’s the same number that was already set, and if the number is the same its a dash, if not it’s a different key.

There are a lot of ways to do it and none of them are wrong. The PressedAmount variable is setup in a not so great way that doomed you from the start i think.

Thanks for the reply.

I see, so I guess I should start from scratch? And sorry for bothering with this, but any chance you could show me that initial part? (an integer variable and anytime WASD is pressed the variable is set to 1,2,3, or 4)

I’m trying to search for a guide but perhaps I’m not looking correctly.

Something like this, probably can use the same logic just switch up the start. Keep in mind I rushed this and it definitely needs customized a bit, just trying to give you an example.

So I have the same as yours in my blueprint, do I now simply attach the ‘dash’ setup to it or would I still need to make changes to the overall setup?

Sorry for such dumb questions, probably need to go back to watch guides.

It would be like this…

W = 1
S = 2
A = 3
D = 4

If you press A and the KeyPressed variable is 3 it will dash, cause you pressed it twice in a row. After that set it to 0 if you don’t want double dashing. If you press it and the last number was 2 it would just set the KeyPressed to 3. You don’t need a pressed amount variable because the KeyPressed variable acts as one, your screen shot has that where the set KeyPressed would go.

If you want it so you have to press the buttons fast for the dash to take effect you can have a custom event set the KeyPressed variable to 0 after a delay. When you stop moving you also would want to set it to 0 so you don’t dash when you move again.

Heres a screenshot since im terrible at explaining stuff. Im picturing a top down 2d zelda type dash, not sure what exactly you are going for. Something has to set the variable back to 0 when you stop moving otherwise you could move north, go afk 5 mins, come back and dash north right away. Your actual movement should be done on the triggered output of the input action if you want it to fire every frame, as well as the dash if its like a hold the button down to dash type of dash.