Toggling NavMeshAgent and NavMeshObstacle

I am close to giving up on the built in Nav components of unity and just building my own. I am building an RTS game, and pathing is very very important.

The closest I have been able to get to my goal is by toggling the NavMeshAgent and NavMeshObstacle on and off. However, when the Obstacle is disabled, it does not update the navmesh fast enough, and the agent jumps from its location.

Is there something I can tap into to see when the navmesh has updated so I can wait to enable my agent

I solved this by toggling the agent and the obstacle in two different Updates().

So on the first Update() loop, the agent is disabled, the obstacle is enabled.

First lets disable the obstacle:

obstacle.enabled = false

Then on the second Update() loop lets enable the agent:

agent.enabled = true
agent.destination = wherever...

I think giving it some time, at least one loop, will help to avoid the “jumping” behavior. Give it a try.