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 can I restrict movement to just 2 axis?


I have a simple question which seems easy to resolve (just can't figure it out).

I have a top down project which used W,A,S,D to move.

I do not want the player to be able to move diagonal...

So when W is pressed the player moves forward, when A / D are pressed at the same time I want the player to move left / right (I do not want them going diagonal).

Any ideas?


Product Version: UE 4.16
more ▼

asked Jul 15 '17 at 03:13 AM in Blueprint Scripting

avatar image

15 13 17 19

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

1 answer: sort voted first

use this node

alt text

if x value != 0 means it's moving on horizontal axis, so if x!=0 you don't allow the input from w and s, use a branch, analog for y and 'a' and 'd'

tell me if it gives you some problem.

velocity.png (30.2 kB)
more ▼

answered Jul 15 '17 at 03:36 AM

avatar image

1.1k 31 18 66

avatar image Tommow Jul 15 '17 at 01:03 PM

Hello, could you please show me an example of how I can use this as I can not seem to get it to work... Thanks.

avatar image Tommow Jul 15 '17 at 01:04 PM

I am using get forward vector and get right vector nodes so I do not understand where I am placing the branches for the !=

(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