Issues with camera and movement stutter on root motion driven looping animations

So I’m having an issue with camera and animation stutter when using root motion driven movement in mecanim. So far we’ve been using our animations with root motion turned off, and controlled by a script to drive the character, but we decided to try it out with root motion driven animations to see if that worked better. However it seems that our camera is having stuttering issues right at the loop point of the animations.

This is not an issue about the camera wobble that happens when Bake to Pose is not turned on. Bake to Pose IS turned on.

I’ve recorded a video to show the problem, apologies for the horrible quality, since my video capture software is awful.

Since I went kind of quickly through the example of the actual problem, I recorded another one of me just replicating it.

So what exactly happens is that at the loop point of the animation the camera does a quick rotational stutter. Just a small annoying jump. This did NOT happen when we were using script based locomotion.

I’m thinking that it may have something to do with our camera and how it’s set up. The camera actually can control the rotation of the character in addition to the root motion, however that functionality is only turned on when the right mouse button is held down, which it is NOT when this problem is occurring. If you look in the video at the position/rotation information for the camera the values are fluctuating all over the place though, so one of our programmers thinks the rotation may be due to some sort of gimbal lock thing going on. I’m not sure WHY those values are fluctuating since the animation has all of the movement Baked to Pose.

The other odd thing I noticed is that when the animation is actually put into a mecanim animator a stutter appears in the looping itself, and is especially evident if you slow the animation down. This stutter is NOT there when you look at the take on it’s own, but appears in the preview only when you’re looking at it through the animator.

If someone has any suggestions on what might be going on here the help would be much appreciated.

old topic, but the answer is probably to update your camera movement in FixedUpdate() when char moves with root motion. At least that worked for me. I know it doesn’t look related, but I had the same problem and that fixed it.