Nav Mesh Agent - need a two second Pause when hit

He there!

I have a nav mesh agent attached to an enemy who chases me with a looping WALK cycle animation. When I hit him with a projectile, he reacts with another 2-second animation called SLAP.

Unfortunately during the SLAP animation, my enemy keeps floating toward me. Any way to make the nav mesh agent pause for 2 seconds?

This is my Nav Mesh AI javascript, also attached to the enemy:

var target : Transform;
function Update()
{
GetComponent(NavMeshAgent).destination = target.position;
}

This is my C# code attached to the enemy that changes the animation:

using UnityEngine;
using System.Collections;

public class AnimChange : MonoBehaviour
{
private Animation _animation;

void Awake()
{
	_animation = GetComponent<Animation>();
	_animation["slap"].wrapMode = WrapMode.Once;
}

void OnCollisionEnter(Collision col)
{
	_animation.Play("slap");
	_animation.PlayQueued("walk");
}

void OnTriggerEnter (Collider other)
{
	Animation anim = GetComponent<Animation>();
	anim["slap"].wrapMode = WrapMode.Loop;
}

}

Thank you so much if you can help!

You can pause, and then resume.

You could also abort the movement completely, and then calculate the path when you want the enemy to start moving again.

If you are moving the enemy with your own scripts, you could stop that movement with a flag, for example, and then continue it along the path.