Stop NavMeshAgent on way to destination

Hi all,

I’m instantiating a tank that travels along a navmesh and once it reaches its destination it starts firing. This all works well so far, but now I want the agent to stop along its path to fire at enemies it encounters along the way.
The problem is that the unit stops for about 1/4 second, fires once and then continues on its way to the destination.
Here is the code I have so far…

void OnTriggerEnter( Collider other )
	{
		if(other.tag == "Enemy" )
		{
			agent.Stop(true);
		}
	}

I’ve also tried calling a Stop() function in the trigger and having that function call the stop function in the navmesh agent.

What am I doing wrong?

Actually figured this out a while ago, just realised I never closed it out.
I had the agent.Setdestination code in the Update function. facepalm