Add Actor Local Rotation & Timeline Lerp

I wanted the actor to perform a 90 degree rotation each key press and the timeline lerp used for the rotation animation. But it spins the actor super fast and the end angle is off from 90 degrees.

It the animation works if I use Set World Rotation or Relative Rotation. But I wanted to use Add Local Rotation to escape the Gimbal Lock.

Any idea what went wrong?

You can’t use add rotation with a timeline. Basically it’s calling that node every frame, so you’re probably getting some crazy kind of spinning movement?

It would probably work fine with set actor rotation :slight_smile:

Ah man :pensive:

is there an alternative way that I can simulate animation for Add Actor Local Rotations like a Timeline lerp?

I’ve managed to find my own solution to this. All I’ve to do is create set of rotator variables that extracts from timeline alpha and add it into the local rotation, while updating another rotator variable (to have start & end point). And it seems like its not affected by Gimbal Lock as well :slightly_smiling_face:

ice_video_20230324-095330_edit_0

1 Like

I know it might look like the answer, but it’s going to trip you up in the long run :slight_smile:

This

is running EVERY FRAME, ie, 120 time per second by default. So you’re actually doing some sort of compound calculation that uses about 1000% more CPU power to get the same effect.

rotate

4 Likes

Noted thanks for the heads up :smile::+1:

1 Like

Maybe quaternion rotation can help: