Input actions one and done

Basically what I am trying to do is have the character not run backwards; they can run forwards as expected, but if the ‘Input action’ is held, they are allowed to run backwards: bad.

Retriggerable delays don’t work, I’m not using a delta (and it just doesn’t work - it ignores the input actions for reasons I can’t say), and I’ve tried every variations of ‘MoveForward’ if statements. A comparison / work around is within Ue5, and that is the enhanced input actions - but this project is in Ue4, and switching would break everything.

Hey @Wolflynxit!

So the question I have for you is:

You want the player to be able to sprint forward, but not backwards, correct? What about sideways?

To fix this it might be as simple as running the white execution line on the False output of the branch on the Pressed event down to the lower line!

Give this a shot!

Unfortunately, this doesn’t work (I had tried previously)
I believe it has to do something with a delta time, and how only the inputs gets called but can’t update on the fly - basically being stuck between two hard parameters without any leeway. So while it may only be called by ‘Pressed’, and ‘Released’, there is no way for it to update based on conditions that would have to be based off of delta. An input action one and done.

I am glad that Ue5 has enhanced inputs because this takes no longer than twenty seconds to get working. The idea was to replicate the ‘Pressed’ (as in current) execute for, let’s say, [Shift] or [J] (Right-side-based tank controls - which is the control scheme) that is founded in the current (is pressed? - I don’t recall what it is called) Enhanced Input Actions.

Had to use a delta time unfortunately but will definitely switch to a ‘Set Timer by Event’ later down the road. Only way I could think of optimizing the delta was having it run during the initial ‘if’ statement that had 2 booleans: MoveForward == 1, and the Sprinting boolean which I fixed. Works this way, and I may just be paranoid of using event tick - but it works.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.