Smooth player character turn rotation
Hi! I am trying to figure out how I can create a smooth turning rotation when switching between moving forwards/backwards and moving left/right.
Here's a video of how it is right now, with instant rotations based on pressing WASD
So I'd like the character to smoothly rotate from his previous direction to his new direction.
asked Sep 12 '15 at 11:01 PM in Blueprint Scripting
You can use a Timeline in combination with a Lerp node:
Granted, this is with 4.8.2 (where it works perfectly) but I don't have the time right now to set up a similar system in a 4.9 project to test it. Basically input your current and target rotation (I'm just changing the Yaw in this example) into a Rotator Lerp (Linear interpolation) node and use a Timeline to update the current rotation for the duration of the Timeline.
For the record, my Timeline looks like this:
The entire rotation takes 0.3 seconds, no matter how large the angle is the character needs to rotate (may be too fast for large angles, too slow for small ones). And the linear "curve" ensures that the rotation changes smoothly each tick.
answered Sep 13 '15 at 11:14 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here