Stop a Navmesh agent mid path

i have a third person hack 'n slash i’m working on and no, it is not a button masher. The combat needs skill to execute attacks plus no
auto targeting. Anyhoo, I’ve hot the player side of things set up and now comes the AI. I’m using Navmesh and mecanim to move the agents.
The agent has a rigidbody with a custom third person controler attached. I can get him to patrol nicely. Then the player shows up and
he has to stop and come towards the player. However my agent is determined to finish his patrol route.

void Start (){
navmeshAgent.updateRotation = false;
navmeshAgent.updatePosition = true;
target = GameObject.FindGameObjectWithTag("waypoint2").transform;
//find game object will change to specific transforms later
}

//then later in update:
navmeshAgent.SetDestination(target.position);

        if (navmeshAgent.remainingDistance > navmeshAgent.stoppingDistance)
            enemyChar.move(navmeshAgent.desiredVelocity);
        else
            enemyChar.move(Vector3.zero);
			
//much later on I pass the Vector3 values to mecanim and animate the mesh.
//this is in another class though

Now go ahead and try to enemyChar.move(Vector3.zero);
He wont stop.
navmeshAgent.ResetPath()? No thanks.
Set him a new destination? He likes his old one. I did manage to het him to stop by miving the waypoint
but that’s not the way to do it I think.
Help.

navmeshAgent.Stop();
navmeshAgent.ResetPath();
Should do the trick

If you want to stop the moving object when its for instance half way to its destination, then u can set the destination to the objects current position.

MyNavMeshAgent.destination = gameObject.localPosition;

Or even easier set the target to the gameObjects local position

target = gameObject.transform.localPosition;

Doesn’t work?
Check out this unity documentation

It has been some years since the last reply. But this works for me now:

nav.velocity = Vector3.zero;
nav.isStopped = true;