Character animation skip

So I’m building a make a player controller with a camera orbit behavior based on this tutorial:

But I noticed that the animation appears to skip a couple of frames in each loop, see attached video. That’s at least what I think is causing the character to “jump” back every now and then.
I understand that a lot of things might factor in to this but I figured I might as well ask if anyone has experienced anything similar or what might cause it?

Character is using root motion based movement and camera movement is updated in lateUpdate.

Original Post on Discord

by user 427134081860501507

Is there blending going on in the animator transitions?

Hey!
Yes, it’s a pretty simple animator controller.

by user 427134081860501507

Hm, that doesn’t look right in Unity either - shouldn’t the loop just move the character forward?

Ok, that was the transitions between states, I think they look right. The loop animations themselves look ok when previewing (character moves forward)
Unity_hQieJmtbFa.mp4

by user 427134081860501507

We’re exporting the animator states and their transitions, so if it doesn’t look right there it won’t look right in needle

Can you adjust the transitions so that it looks correct in Unity and try again?

Thank you @herbst🌵 , but I fail to realize what’s not looking right with the transitions in the animator🙂 They are showing the blending between states.
I have used this animator before for other player controller setups and the animations looked fine then. I should have added this to my top post, will edit.

I have a workaround that is **not **root motion based (just apply movement to forward direction), which works fine (attached).

by user 427134081860501507

To me it looks like the transitions aren’t set up correctly because when you preview them it doesn’t loop, but I may be wrong

Maybe @marcel :cactus: has some input too :slightly_smiling_face:

Thanks, I really appreciate the feedback😀

by user 427134081860501507

Hi, do i get it right that the animation doesnt loop smoothly when you have rootmotion enabled but the same controller is fine with rootmotion disabled?

Hi @marcel :cactus:
In this case yes, but I have used the controller for other setups and the animations did loop smoothly then.

The player controller script rotates the player in the input direction, could that be the source of the problem?

by user 427134081860501507

mmmh it should not be a problem, root motion and the animation mixer is updated in onBeforeRender so after your input modifications have happened. I have also tried this case (modifying the transform from a script with root motion and looping animation) and didnt notice looping issues. Could you perhaps send a bugreport with your scene and the problematic input?

You are not using the speed or cycle offset properties in the animator state right?
And the animation itself is set to loop?
Maybe you could try disabling loop in the animation in Unity and instead adding a transition to itself (if no other transition triggers)?

@marcel :cactus: speed is constant 1 and no cycle offsets. I will try adding the transition when I get the time.
Thanks for looking into this!

by user 427134081860501507

@Snorulf you didnt send a bugreport right?

Hey @marcel :cactus: , I did not get around to do that yet no

by user 427134081860501507

Ok no problem :slightly_smiling_face: