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"

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.

Product Version: UE 4.9
more ▼

asked Sep 12 '15 at 11:01 PM in Blueprint Scripting

avatar image

19 8 8 11

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

1 answer: sort voted first

You can use a Timeline in combination with a Lerp node:

alt text

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:

alt text

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.

more ▼

answered Sep 13 '15 at 11:14 AM

avatar image

1.8k 69 28 114

avatar image Mr-Manly Sep 13 '15 at 11:16 AM

Where do I call this event? And when you say it runs perfectly on 4.8.2, are you implying that the same setup does/will not work on 4.9?

avatar image erinacea Sep 13 '15 at 05:47 PM

Like I said, I haven't gotten around to try it in 4.9 yet. However, both the Timeline and the Lerp nodes look the same, so I see no reason why it shouldn't work.

I'd suggest to replace your current Set Actor Rotation call with a setup like in my screenshot. Before you call the Timeline, call Get Actor Rotation, save that into a Rotator variable. Pass the variable into the Lerp node's A input and the target rotation into the B input.

avatar image Mr-Manly Sep 13 '15 at 06:01 PM

I still can't see where I'm supposed to do this custom event :/ Here's an image to better show my confusion:

alt text

I have a stationary camera that I have set the directions of the player for, if it is being used.

hmm.png (211.2 kB)
(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