Isssue with navmesh agent

Hi,

Here’s a video of my issue:

The agents are suppose to go to the white cube on the left but for some reason half of them zoom right past it while the other half are just glitching in the buildings…

The agents just have a script with the following update function in it:

void Update()
{
agent.SetDestination(GameObject.Find("goalLocationLeft").transform.position);
}

Any idea why they are behaving like this?

Perhaps calling setdest within Update indefinitely is what is causing it. I’d set a condition in update, and pass the SetDestination in it’s own function so it’s not called indefinitely within Update. Also, set the goal location as a variable at start. Or, at least set it within a condition once so you don’t have to call it every frame - that’s a lot of overhead. Also, I can’t tell in the vid but is the object on the ground? i.e. on the navmesh level?