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"

Is there a Rotation Follows Velocity for characters?

I'm using the default sidescroller template with a custom character who's set up almost the same way as the default template character.

It's rotating to the direction he's moving (via "Orient rotation to movement" and Rotation Rate Yaw: 720), just like the default does. This is perfect for walking, but insufficient for swimming.

The character can swim, in 8 directions via WASD, or 360 via touch.

  • Rotating the mesh on the x axis in the viewport gives me the kind of rotation I expect, but unfortunately, adjusting the Roll (x?) Rotation Rate under Character Movement (General Settings) doesn't seem to do anything.

  • Adjusting the Rotation Rate for Pitch (y?) makes the character rotate when swimming, but in unexpected directions.

  • Adjusting the Yaw Rotation Rate (z) makes it turn as expected.

Maybe I shouldn't use these values to rotate the character when he's swimming?

I found out that projectiles have a "Rotation Follows Velocity" node, but it seems it only takes in a projectile. I'm pretty sure this would give me exactly what I want, but I'm not sure how I could modify it to work with a character.

Anyone know how I might get the character's rotation to follow its velocity? I've spent a couple hours trying to get it to work but haven't really made much progress. A link to an in depth tutorial about character/capsulecomponent rotations would be extremely appreciated!

Thanks

Product Version: UE 4.12
Tags:
more ▼

asked Jun 20 '16 at 05:16 AM in Blueprint Scripting

avatar image

kusokuso1
352 35 36 56

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

1 answer: sort voted first

No need for that node. Just get your Character's velocity and use "Make Rot From X" node to make the rotation for your Character, and finally set your character's rotation using "Set Actor Rotation" node.

more ▼

answered Jun 24 '16 at 03:01 AM

avatar image

BlinkSpark
23 1 2 6

avatar image BlinkSpark Jun 24 '16 at 03:07 AM

Beware that only when the velocity is bigger than some value(according to your case),the rotation is valiable to use, or else it will be some unexpect situation.

avatar image kusokuso1 Jun 24 '16 at 03:20 AM

Hey BlinkSpark! Awesome, thanks a bunch for that info.

When you say set your "character's rotation" would it be the rotation of the capsule component? (the skeletal mesh is parented to the capsule component just like the default template character is...)

Anyway, I'll try to hook that in right now!

Edit: GetPlayerPawn seems like that's what I should be getting the velocity from and setting the rotation of. (?)

avatar image kusokuso1 Jun 24 '16 at 03:37 AM

BlinkSpark, Please disregard the question I asked about which character component to use. GetPlayerPawn does the trick. I gotta muck with some values to get the proper rotation (seems like it's fighting with the Z). Regardless, this is totally what I wanted

Thank you very much for taking the time to respond and lay it out for me. Much appreciated. I'll take note of the warning regarding low velocity producing unintended behavior.

avatar image Eskel Feb 18 '17 at 06:25 PM

blueprint This works for me pretty well. (Minimum Velocity to Rotation set to 250) Thanks for pointing me into the right direction.

(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