How to get data for holes in navmesh

Is there a way to get the vertices/edges that make up a hole in a navmesh? For example, the white poly in this image?

Not sure what you are trying to achieve, the only way I know to get hold of the mesh is to do this:

NavMeshTriangulation navmeshData = NavMesh.CalculateTriangulation();
Mesh mesh = new Mesh();
mesh.SetVertices(navmeshData.vertices.ToList());
mesh.SetIndices(navmeshData.indices, MeshTopology.Triangles, 0);

Then run a hole detection algorithm against this mesh. Unfortunately you cannot change the mesh and assign it back to the NavMesh, if that is what you wanted to achieve.

1 Like