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 to constrain my player character to only move at 45 degree angles?

HI, I'm trying to create a way of moving only at 45 degree going forward. my issue right now is that I've done so but when I press the down key it goes in reverse and I'd like to convert the reverse movement at the 45 degree angle to a forward movement down at a 45 degree angle. any help with this would be very much appreciated! thanks, Patrick

Product Version: UE 4.16
Tags:
more ▼

asked Dec 22 '17 at 08:46 PM in Blueprint Scripting

avatar image

Ambitiousxrush
3 1 3

avatar image vr_marco Dec 22 '17 at 09:09 PM

Can you show how you do your movement? Otherwise we can only guess.

avatar image Ambitiousxrush Dec 23 '17 at 01:14 AM

Sorry for the late reply, i made this video to show what meant by the movement im trying to achieve

https://www.youtube.com/watch?v=gcS7RNSkWEc&feature=youtu.be

avatar image vr_marco Dec 23 '17 at 04:42 PM

Not having seen your movement code and assuming your pawn has a Character Movement Component, try to use Add Movement Input with a World Direction having equal X and Y components but with all sign variations (positive X, positive Y ; positive X, negative Y and so on). You should obtain a movement along all 45 degrees angles.

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

3 answers: sort voted first

alt text

the Right vector points Right while the Forward points up for your example

On W you add both you get a 45° pointing up+right between them and move in that direction. On S you add the negated right vector + to the forward and get a vector pointing up+left, but since you axis input is -1 you move the other direction down left

diagonal.png (51.4 kB)
more ▼

answered Dec 23 '17 at 11:24 PM

avatar image

dark-killer
55 3 5

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

Hey there, a video would be helpful to see what you mean.

more ▼

answered Dec 22 '17 at 10:38 PM

avatar image

xlar8or
6k 162 129 305

avatar image Ambitiousxrush Dec 23 '17 at 01:14 AM

Sorry for the late reply, i made this video to show what meant by the movement im trying to achieve

https://www.youtube.com/watch?v=gcS7RNSkWEc&feature=youtu.be

avatar image xlar8or Dec 23 '17 at 01:25 AM

The video is not working.

avatar image Ambitiousxrush Dec 23 '17 at 01:34 AM

sorry i had it on private, it should work now

avatar image xlar8or Dec 23 '17 at 11:44 AM

Will he always walk in that axis? can you show me your movement blueprint nodes?

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

Thank you so much @dark-killer sorry to everyone on the thread and being so patient with me. thanks guys and have a great holiday!

more ▼

answered Dec 24 '17 at 04:41 AM

avatar image

Ambitiousxrush
3 1 3

(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