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"

Smoothly rotate character 180 degrees

I'm trying to have my character rotate 180 degrees (or some arbitrary angle) smoothly and I'm using a timeline and a rotator lerp. It's lerping from actor rotation to control rotation

The problem is that because the delta continuously gets smaller, the lerp reaches its target at an exponential rate.

I thought I could solve this by setting the actor rotation as a variable before the timeline and lerping from that, but that doesn't work out well because I need to use shortest path on the lerp (to avoid loops). Since the actor rotation is static, if I alter the control rotation too much, it's reinterpreting what the shortest path is and basically doing an instant 180.

Any ideas on how to get around this?

Product Version: UE 4.20
more ▼

asked Aug 19 '18 at 05:43 PM in Blueprint Scripting

avatar image

1 1 2 3

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

1 answer: sort voted first

Well I made this: alt text And it uses the shortest path every time.
Instant 180 in your case might result from using Play on the timeline instead of Play From Start, if I got it right.
The only problem in this case is it always takes the same amount of time to turn, no matter if it's 180 or 5 degrees. If you want a steady turn rate you'll have to calculate the angle to turn and set the timeline play rate respectively. Hope this helps.

turn.png (131.9 kB)
more ▼

answered Aug 19 '18 at 07:39 PM

avatar image

1.8k 12 7 9

avatar image mlindborg Aug 19 '18 at 08:12 PM

Hmm it's not quite what I'm going for, I need it to lerp from actor rotation to control rotation (which can be changed)

Here's what I tried but this flips the rotation when you move the camera in the opposite direction alt text

If I use a regular lerp (or ease) it doesn't jerk but it takes the long path

capture.png (166.5 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