How to rotate an object with a script after an animation has rotated it?

I’m flying a space ship using a chase camera. When I use the left/right arrows, my script causes the ship to tilt based on its velocity like this:

objectToTilt.transform.rotation = Quaternion.Euler(0, 0, body.velocity.x
* -tilt);

This was working PERFECTLY until I introduced a state to an animator on the same object which also controls rotation (360 degree roll). The code above now seems to have no effect, even when the animation state machine is in an idle state which has no clip associated. I feel like the animator is sort of ‘holding’ my object’s rotation where it wants. How do I tell the animator to ‘let go’ when I want to have script control of my object’s rotation?

Do you have to have both on the same object?

If you just split the animation out to a parent object and keep your rotation script on the child object, you should get the behaviour you’re expecting.