Agent Radius while traversing NavMesh

Question:

a) How could I store different NavMeshes per agent radiuses?

b) How could I adjust the calculated path, so agent will account for its radius while
traversing in Unity?

Let’s say I have a NavMesh generated with unity 3.5.
It was generated for an agent of specific radius.
If there will be an agent with larger radius then current NavMesh will not fit.

I’ve tried to use NavMesh.CalculatePath to get initial path and then adjust it before setting with NavMeshAgent.SetPath, but unfortunately NavMeshPath.corners is read only.

So I had to subsequently call SetDestination for each adjusted edge, which provides unsatisfying results due to the increased performance overhead and deceleration before the destination being reached.
I’ve managed to avoid deceleration by extending the path twice and the canceling the movement half way.
It is really hacky and slow right now.

Any help \ advises would be greatly appreciated.

hi,

Could you not use NavMeshLayers. I believe you would be able to achieve this, having one navMesh layer bigger than the other and then masking agents ( big radius → to layer with more room, and agent with small radius to layer with less room).

In the samples provided, Door2 defines area where blue agents can not go and where red agents can not go, I think the principle would apply for your needs. Check out the Bridge scene as well, it has actually a dynamic change of the navMesh by opening a bridge and Agents automatically readjust their path.

Hope that helps,

Jean