Wrong rotation

Hi.
I’m loading level instance with transformation. That level has character and some objects. If you tap on object char should look on it.
When level spawning with rotation of 180° +/- char starting to rotate strangly.

If you tap on A char will turn around. If after tap on B char will turn around again. But if after B you tap on C all ok.

Rotate by using “Find look at roration” and lerp (lerp only Z or by full vector, no mater).
Using “Get world location / rotation”.
Notice that if char rotation is positive, target rotation negative and vice a versa.

How to fix this?

Can you show the code? ( are you using a timeline? )

Changed logic to this:

Timeline from (0,0) to (1,1).

And test level:

If tap between A and B char will turn around.

Notice that even without initial level rotation char has same behavior for two cornered targets. Only for two.

Problen in rotation calculation?

Ok, there’s two things:

  1. In a timeline, you have to pre-calculate all coordinates before going into the timeline. You’re sampling the actor rotation during the timeline, which will give you all kinds of weirdness. And possibly this along will solve your problem.

  2. Almost all the rotation nodes in blueprint suffer from the problem that the engine likes to correct 180 to -180 and vice versa. There are two ways around this I know, Quaternions, or using rinterp ( in some circumstances ). So, have a go with (1) above, and if this doesn’t solve it, I’ll show you the rinterp method.

I pre calculate rotations before timeline. Inside it I only use lerp with this values. Problem is still there.

On level without transform (we should forget about transform, problem exist even without it):
at init char look at forward (top) obj, rotation = 0
for backward (bottom) obj rotation = 180
for left obj rotation = -90

P.S. Animation become slo-o-o-ow )

Somehow I fixed this!

But I lilbit misunderstand how RinterpTo work. Why if I set InterpSpeed to 0, char will teleport to target rotation ignoring timeline?

So, it’s basically this

1 Like

Thanks for the help!

In my variant, timeline become something like EventTick )

Timelines use tick, actually :slight_smile:

Yeap )

1 Like