Download

Difficulty Using Enumerator to Map Two Buttons to One Action - Dashing in Four Directions

Hello,

I am a beginner at Unreal Blueprints and I got advice the other day from Reddit about how to map two buttons to one action using an enumerator, but, I’m stuck at a step.


Now, I just want it so that dashing down is the default and only requires one key, the dash button. The other three directions would require two buttons, the dash button and the direction (Up, Left, Right).

I want it to be able to play like this: Imgur

I don’t know what to do from here. Any help would be greatly appreciated! I can provide more information if needed.

For actions influenced by multi-directional inputs, I’d use bools instead.

Like, *isLeftHeld? isRightHeld? *etc. The reason being, for a neutral dash down, your other directional inputs would have to reset the enum on unpressed; but those inputs will also fight eachother for it. I.e. if you pressing diagonally up and left, but roll your thumb over and lift off of left, you should be able to dash up but unpressing left means the enum is now reset so you dash down instead.

Ok so, each direction should have a bool that toggles on when pressed, toggles off when unpressed. Down pressed does not need a bool in this instance, but you might decide to you’ll need one later; reason being that dash should treat down as the nuetral/default input/direction, so you don’t have to check isDownPressed? in the dash execution line.

Now if you needed an 8-directional control scheme, each input would branch to check if its neighbor direction is pressed, if true then set an 8direction enum.

Yeah, that’s what I’ve been told to use instead too.

OK, that makes sense.

Now, my problem is that I’m a real beginner at this and I don’t know how to map this out, I know what a boolean is, but I don’t really know how to implement it in Unreal Blueprints itself?

Oh yeah, that definitely won’t be needed, only sticking with four.