Difficulty Using Enumerator to Map Two Buttons to One Action - Dashing in Four Directions
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.
I don't know what to do from here. Any help would be appreciated.
asked Oct 19 '18 at 01:20 PM in Blueprint Scripting
I would do it just how you have it with a few changes:
Create input mapping in project settings where you have your 2 input axes for up/down and left/right, I'd also make it so there is one InputAction for each single direction: One for up, one for down, one for right, and one for left.
Using these same direction keys as ACTION inputs allows you to use the On Press and On Release execution pins in their input events. You can use those to set the Direction enumerator to match the most recently pressed direction, OR to set it to the default on Release of the buttons. You may need to also track which buttons are all pressed simultaneously with a set of booleans or a bitmask, in order to make sure it only sets to the default dash direction if ALL the buttons have been released. But maybe not. Try it without that first and see how it acts.
answered Oct 19 '18 at 09:55 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here