x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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

Hello,

I am a beginner at Unreal Blueprints and I asked for some advice the other day about how to map two buttons to one action and was given the advice to use enumerators, 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.

I want it to be able to play like this.

I don't know what to do from here. Any help would be appreciated.

Product Version: UE 4.20
Tags:
more ▼

asked Oct 19 '18 at 01:20 PM in Blueprint Scripting

avatar image

pchanliau
15 2 3 6

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Oct 19 '18 at 09:55 PM

avatar image

mightyenigma
3.8k 18 23 20

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question