Animator.Play causing character to teleport and play the animation.

I think this is probably related to the animation itself, but I don’t know what causes it.

I am just calling this:
GetComponent().Play(“AnimationName”);

and my character teleports far away then plays the animation.

EDIT: other animations do NOT cause this problem, the character stays in place.
EDIT2: Turning off apply root motion on the animator solves the issue but I actually need root motion to be on.

You need to check the animation clip import settings of the faulty one and compare with the others.
It’s probably one of the following:
1-You have baked the transform position in the animation clip setting
2-The Root transform option “based upon” has a different setting than the animation being played before that
3-The Root transform selected has a different initial position than the others. Not sure about this, but check anyway.

1 Like