How to make double tap axisinput?

Hi, I have found other posts like double pressing any action button, but I actually need to work with double tapping axis input. For example I want to dash with double tap and holding forward InputAxis (in my case up arrow, and gamepad left stick). How can I set this in character blueprint?

I was just looking into dashing myself and came up with this method. This doesn’t put any limits on the frequency of the dashing or anything, but I have a dash working with a double-tap of the joystick. I made mine for a sidescroller, so you could take some steps out to do this for a forward dash instead of left and right.

To explain - the basic movement will be whatever you already have, but in addition to moving the character, the input should set true a boolean that will allow the character to dash in that direction. This variable will reset itself to false shortly after becoming true so the joystick must be flicked in rapid succession to succeed. In addition to this variable, another boolean is needed, which ensures that a dash won’t occur unless there’s a period of no movement input being received between taps of the joystick (otherwise dashing would be constant), and both of these must be true in order to enable the dash. Like the other, the second boolean needs to reset itself shortly after becoming true.

Once the variables are set, you’ll need to check them through the movement input, and if a double tap of the joystick registers, the character will dash in that particular direction. In my case here, I set the velocity and removed friction to give the character a burst of speed for each left and right, then after a delay reset the friction to my standard character friction. In your case of course you’d only need to do this in the forward direction. The character will continue receiving movement input while the dash is going on if you use a sequence node like I did, but you could also connect the end of the dash back into the movement input so you pick up standard movement again only after finishing the dash.

I’d suggest a third boolean that defaults to true, but is set false at each dash, resetting itself after a delay like the others, but that depends on your game. This could be added to the requirements of enabling dashing, and would add a cool down period so dashing couldn’t be spammed.

1 Like

I just had a thought right after posting, but via the method I posted, the double-tap isn’t a full double-tap. If you change the variable I called DashReady to an integer, you can make it feel a little better. When setting the variable, instead of setting it to true, set it to itself+1 (default 0), and then instead of setting it false after the delay, set it back to 0. Then instead of checking whether the variable is true or not when checking the variables, check if DashReady is greater than 1. If you do it with the boolean you’ll be able to dash by holding forward, releasing briefly, then pressing forward again. With the integer, it’ll check to make sure there are at least two releases, which means you’ll have to press forward twice - holding won’t count.

Hello razee01,

I was looking over your issue and I was able to mock up a quick example using the first person character. This may be a viable solution depending on your needs. I have provided the example below. I hope that this information helps.

Example:

In this example I have used a custom event to help clean things up a bit. In the comparisons you will see 0.9 and 0.2, these are what I found to feel comfortable on the controller that I was using. Please feel free to modify the values as you see fit for more or less precise input from the player. You will also see the delay node is set to 0.2. Once again this was what I found to feel right. This delay represents the amount of time the user has to double tap the joystick to activate the dashing.

In short this checks to see if the stick has been pressed beyond the 0.9 value (the first tap) and if it has, it will then check to see if the value falls below this point (drawing back on the stick to prepare for the next tap). After this, the user has 0.2 seconds to push the stick beyond the 0.9 value again in order to activate the dashing feature. Otherwise the multi gate will become reset (so that it fire out of “Out0”).

Make it a great day

Thanks! This is almost flawless but somehow I have to add another set of Delay at the beginning of “Set Dash Variable” section to enable double tapping dash (and disable pressing down style dash)