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"

How do I add buttons to conditions?

So I want to make my character sprint when W + Left Shift buttons are pressed at the same time, so when you strafe (A, D) or walk backwards (S) you couldn't sprint. The blueprint is attached below.alt text

I'm a very beginner to UE4, so I need very much help.

Thanks :)

Product Version: UE 4.21
Tags:
screenshot-12.png (310.2 kB)
more ▼

asked Jan 07 '19 at 08:55 PM in Blueprint Scripting

avatar image

Voicu Andrei
8 1 1

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

2 answers: sort voted first

Here is what i would do: Go to Project Settings -> Input and create a new action mapping for sprinting. Then in your character BP get the action event and set the speed for your character when it is pressed and released. When you start to move with holding SHIFT you should run and with releasing SHIFT you should walk.

more ▼

answered Jan 08 '19 at 01:51 PM

avatar image

MisterHB212
21 1 1

avatar image Nebula Games Inc Jan 08 '19 at 06:55 PM

You can set a requirement for the shift key to be held for a specific action. This way whatever action you map to a specific key it will only work with Shift+Key down. So you don't even need to mess with the character BP press/release just a direct map to sprint with Shift+Key down.

avatar image Voicu Andrei Jan 08 '19 at 07:09 PM

Thank you guys very much for helping me! This will probably speed up my entire game-building process! :)

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

I came up with this: alt text

Maybe I'm overthinking stuff; but you can't use modifier keys for axis mappings, and you probably won't use action mappings for movement. What you can see in my screenshot is basically "If the character is looking towards where he sprints, carry on; if he's looking some other way (strafing or running backwards), stop sprinting".

sprint.png (217.0 kB)
more ▼

answered Jan 08 '19 at 07:34 PM

avatar image

Tuerer
1.8k 12 7 8

avatar image Nebula Games Inc Jan 08 '19 at 07:38 PM

True, but you could always have the action map to a timer so it functions like an axis and then on released clear the timer.

(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