# Why are multiple Nav Mesh Agents jittery when the target is inaccessible?

I have a simple scene. Most of the land is flat, except for three raised cylindrical platforms coming up from the ground. I have several enemies with Nav Mesh Agent components attached, with their target being the player. I used the Standard Assets' ThirdPersonCharacter script, and then called character.Move(agent.desiredVelocity, false, false); within the Update() of a character control script.

The agents work great when the player runs around on the ground. When the player hops on the platform (about 2 units above the ground), an agent will walk toward the edge of the platform and then stop, just as expected. However, if I throw in a second agent, both agents work fine only until the player stands on the platform. Then they start to jitter, like they cannot make up their minds on whether to turn left or right when they should really just walk straight. If I add even more agents, the jittering gets worse. With enough, they don't even move forward and simply turn left and right rapidly.

Clearly, there is a problem with interference, and I understand the agents are designed to avoid obstacles as well as each other, but here is what I found and tried so far:

• I switched the obstacle avoidance quality to None. The jitter still happens just as much.
• Some other posts suggested setting IsKinematic to true for moving obstacles. I cannot do this because the character script depends on the rigidbody not being kinematic.
• I adjusted the height of the platform and re-baked the navmesh. It had no effect. It must be the fact that the platform is not actually accessible, so that the agents can only make a partial path.
• I messed with the pathfinding settings on the agent, such as turning auto repath off, since it has to do with partial paths. There were no noticeable changes.

Does anyone know what might be causing the jitters and how I could fix this?

# Update

As requested, here is how my Nav Mesh agent is configured:

• Could you please show the settings of the navmesh and navmeshAgent with the code you are using to move units with navmeshAgent? So we could recreate this on our devices or see if the problem lies in the code. – Candid Moon _Max_ Feb 16 '17 at 16:31
• @CandidMoon, I added a screenshot of the inspector for the Nav Mesh Agent. I haven't made any significant changes to the Standard Assets' ThirdPersonCharacter and AIThirdPersonController scripts, so assume I am using those. – tyjkenn Feb 16 '17 at 17:54

## 3 Answers

I had this problem and I was messing around with the Nav Mesh Agent and found out turning off "Auto Braking" fixed the problem.

• The Stopping Distance may need increased slightly as well. – Chad Mar 14 '18 at 15:24

Try setting the priority of all the Agents very low, except one, and see if this exact Agent is also facing the same issue as the others. To me it sounds like the agents were constantly trying to find a new path, as the other agents get too close.

• It tried this. It didn't change anything for any of the agents. However, strangely enough, the glitch became less frequent when I made a slope to one of the platforms, even when I would stand on the other slope-less platforms. – tyjkenn Feb 16 '17 at 17:44

When having the stopping distance at 0.3 with no autobreaking a weird behaviour shows where they reach the destination but then move back a bit. Setting the stopping distance to 1 works.