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 make my character look allways to the movement direction?

alt text

My problem with this groups of nodes is that when i am going foward (w) and i press other key while holding w the character change the rotation so i can still going foward but facing to other direction.

So, how can i make my character allways look to the direction he is moving??

Product Version: UE 4.16
Tags:
movimiento.png (205.3 kB)
rotacion.png (227.1 kB)
more ▼

asked Jun 09 '17 at 12:23 AM in Blueprint Scripting

avatar image

Faquina
1 2 1

avatar image Faquina Jun 09 '17 at 12:26 AM

in movimiento.png you can see my movement nodes in rotacion.png you can see my rotation nodes

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

1 answer: sort voted first

Try storing the current position in a variable called OldPos. This is a vector. Then, every tick you get the new position NewPos and do this:

FaceDirVec = NewPos - OldPos

Then you can use the get look at rotation with NewPos as the Start input and NewPos + FaceDirVec as the Target input. The returning rotator will be correct and you can use it to set the pawn rotation.

HTH

more ▼

answered Jun 09 '17 at 12:29 AM

avatar image

NoobsDeSroobs
2.7k 107 35 180

avatar image Faquina Jun 09 '17 at 04:51 AM

Thanks for the reply. I solve the problem. I found and option inside the character blueprint, in the characterMovement componet. Its call character movement rotation. I set Z rotation rate to 10000. Now works just as i wanted. With out adding any node :D

(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