- Home /
My NavMeshSurface appears as calculated, but seems unusable
I'm using the standard NavMesh additions (https://docs.unity3d.com/Manual/class-NavMeshSurface.html) and seeing a strange issue when I try to generate a secondary NavMesh with my own created area. I see the areas drawn out for both the default Walkable layer as well as my own Fate layer.
However, when I try to use NavMesh.CalculatePath with the areaMask set to just the Fate layer (mask = 8), it fails to generate anything. Even if I set the mask to use all areas, it doesn't actually use any of the pink areas on the map. It's as if the Fate area actually isn't calculated at all, and I don't understand why. Is there some step I'm missing?
Answer by IlMatteo · Oct 08, 2021 at 03:28 AM
Of course I figured it out shortly after posting this-- my problem was that the NavMeshSurface wasn't set to use the Layer that my navigating object actually belonged to. It seems that the NavMeshSurface needs to not only contain the layers you want to bake for the surface, but also the layers containing your agents / objects you plan on calling CalculatePath on.