Why the scaling and rotation animations behave differently when applying the physics engine?


I have a question about the relationship between animations and the physics engine.

I’m trying to do something like this:
Step one: Animate a mesh with a simple rotation.
Step two: stop the animation.
Step three: apply an impostor on the mesh (to have a realistic rebound effect).
Last step: remove the impostor and restart the animation.


As you can see in the playground, I have two different behaviors:
If the animation is about scaling, everything is fine. But, for the rotation, I encounter a problem: the animation never restarts.

Can someone explain these two different behaviors to me, please? Is there a way to properly restart the rotation animation?

Thank you !

Pinging @RaananW

A simple reason :slight_smile: The physics engine is setting the rotationQuaternion of the object. Once the object has a quaternion, rotation.x will not animate, as it will take the rotation from the quaternion instead.

One option is to set it to be undefined:


The other is to use the rotate() function instead of animation for the rotation part. But I will leave it to you to decide which fits better :slight_smile:

1 Like

Thanks for the explanation and for responding so quickly! :clap:

1 Like