how to use my double button press with an axis event movement.

hello everyone, im new here.
im not a programmer but ive played with this a lot before asking for help.

problem: implemented double-tap/click does not work with axis mapping.
this is a problem because i want the player to be able to change mapping later so i don’t want to bind actual keys to movement in the blueprints.

i have double click as a function
then after input axis event, i call the function (I’m trying to 2 things with the same key)

if the single press, it will move the character in the desired direction
if double hit, it will dash or jump/flip the character in the desired direction

video Unreal Engine 4 25 1 input axis mapping wont allow double tap click please help - YouTube

If you ask me it looks like a bad way to do a double-tap, you creating an input delay with your Delay try to do it with only a branch and sequence with a delay then if the button pressed twice change the condition to false/true and go to double-tap and don’t use axis for double-tap leave the other logic there but move the double-tap to button press. Axis always gets input almost like tick what you need is only when you press the button to get a input not constant and if not mistaken you can change mapping whatever you want in blueprint so you don’t need to worry about that as well.

ok thanks, ill try the changes as well.

idk much about blueprints (i only know a small amount of logic)

ill set it up with the key instead, my big plan is to make it so every value in the game can be configured later. for right now im just learning the blueprint system the best i can.

thanks for the response, i fell asleep lol.

i tried without the delay, and even tried a few ways without setting a var, if i do not have a delay but i use a sequence, then it won’t detect the second press. ill just keep a delay i guess.

the code i showed wasn’t 100% working because it wasn’t always detecting. but what i have now is so ill use this for now and try to make it better in the future.

That’s not even my final form!

I mean, you do want to observe some conditions, at least the time between the first and the second taps. The delay is optional, of course.

Here’s a simpler version with no delay and no variables:

Here’s my take on it:

First, leave your axis input alone and create an action input with the same key. Yes, they will both work simultaneously.

Next, I came up with this:

Create 3 variables: 1 bool and 2 floats (Is Dash Allowed, Time to Double Tap, and Delay Before Next Dash respectively). Time to Double Tap is time within which the player has to press the key the second time; the other two are pretty much self-explanatory.

Dash Gate is a custom function that you can create yourself. Otherwise you can just connect the respective execution pins to Open Gate and Close Gate, but this way it’s cleaner.

Hope this helps.

Edit: P.S. Make sure to uncheck the Start Closed in the Gate node, or it will never work.

Nice double tap but totally overkill

Holy moly, I usually don’t use a lot of gates and timers so even though I do understand it this is a little bit over my head.

Thanks for the responses, im using your second one.

i would have liked to make this into a macro or function, timers and events cant be used in a function or macro.

im trying to make it so i can use this multiple times. im also trying to make the character dash in whatever direction the player “inputs”
im also using the “DoubleTap” to change from run to sprint

i have it set up where pressing the movement keys make you walk
if you hold shift then you run
if you double tap a directional key while holding shift then you sprint
walking uses no stamina
running depletes stamina at the same rate that you can restore it (regen wont happen while running)
and sprinting uses up stamina 2x as fast as it can regen

your code is magnificent, im just trying to be more efficient with how much code is added.