Unity NavMesh but not NavMeshAgent? (to solve different size agents)


What I would like to do is use the Unity NavMesh feature to build a navmesh. I then want agents walking around with a certain clearance (say x). This can be done by setting the radius to x.

However, I ALSO want agents walking around with a smaller clearance. (say .5x). I don’t think there is any way that the build in Unity NavMesh(Agent) supports this… I could trick it by setting the radius of the larger-clearance-agent to x, but then the other agents use that distance for collisions too, which I don’t want.

So now I’m wondering if there is any way that I could use the NavMesh feature from unity but write my own NavMeshAgent class, to somehow solve this problem. I don’t really know how to actually access the navmesh though… Anyone have any ideas on this?


I’ve found a workaround solution for this problem (I’m also working on a game with both small and large agents). Here is the forum thread in which I’ve posted the solution:


Hope it helps a bit,


Well according to Unity this is the answer:

If you want to use NavMesh layers, go to Edit => Project Settings => NavMeshLayers instead of the normal layers and use NavMesh.GetNavMeshLayerFromName instead of LayerMask.NameToLayer