How to prevent the animator from changing my rotation?

I am using an animator which plays certain mecanim animations when certain conditions are met. I am also using a third person camera control script which sets the camera to follow the character and orbits based on the character collider’s rotation.

My problem is that certain animations seem to change the collider rotation, thus swinging my camera round slightly, this means that any animation where the rotation of the character is affected will end up moving the camera around when it isn’t required. Is there any way to either change my camera control or the animator so that certain animations don’t affect my characters rotation, or at least the collider component attached to it?

Any help would be much appreciated.

I managed to figure this one out myself, I had played with the Bake Transform Rotation option earlier but I must have just done it wrong. After checking the box to Bake Transform Rotation in the animation Inspector, I entered a value in the offset to make the average velocity of the X axis 0. This meant the camera was no longer affected and the character maintained its course going directly forward.

You can use LateUpdate() when applying your rotation.