How to prevent an animation from interfering with NavMeshAgent movement?

I downloaded a simple asset from the store that is supposed to provide some animations for humanoid characters. It comes with an animation controler (Mecanim).

The problem: I can’t use it with NavMeshAgent. As long as the animation is set to Idle, everything works fine - after issuing NavMeshAgent.destination = somegoal my character runs (er… slides) to that goal and stops.

But if I set the animation to make the model run, my character will no more reach its goal, but rather it will run circles around it endlessly.

What I really, really fail to understand is why this keeps happening even though I explicitely set NavMeshAgent.updatePosition and NavMeshAgent.updateRotation to true? The way I understand the documentation, this should force the character to move as the NavMeshAgent wants it to move, not as the animaiton wants it to move!

Here’s my very simple code:

public class MoveDestination : MonoBehaviour {

	public Transform goal;

	private NavMeshAgent agent;
	private Animator animator;

	void Start () {
		agent = GetComponent<NavMeshAgent>();
		animator = GetComponent<Animator> ();
		agent.updatePosition = true;
		agent.updateRotation = true;

		agent.destination = goal.position;
		animator.SetBool ("Moving", true);
		animator.SetBool ("Running", true);
	}

	void Update() {
		if (agent.remainingDistance == 0) {
			animator.SetBool ("Moving", false);
			animator.SetBool ("Running", false);
		}
	}
			
}

How to fix this?

The correct answer to this problem comes from StackOverflow, navmesh - In Unity, how to prevent animations from messing with the movement? - Stack Overflow . It reads:

Do all your animation in place and use
code to do the movement and you can
uncheck root motion and use state
machine values to get a better
movement or use root motion and let
mecanim`s retarget engine do the
blending so go see for yourself what
gets you better result , so I guess
your problem is that your animation
are not in place.

Yes, unchecking Apply Root Motion worked for me like a charm.