Invalid vertex data in source mesh prevents navmesh creation

I have a flat terrain with several buildings, furniture and decoration (all prefabs) on it. When I try to create a navmesh for it, Unity tells me that the “Source mesh has invalid vertex data and will be skipped.” So no navmesh is created. The full error message is:

RuntimeNavMeshBuilder: Source mesh has invalid vertex data and will be skipped.
UnityEngine.AI.NavMeshBuilder:UpdateNavMeshDataAsync (UnityEngine.AI.NavMeshData,UnityEngine.AI.NavMeshBuildSettings,System.Collections.Generic.List`1<UnityEngine.AI.NavMeshBuildSource>,UnityEngine.Bounds)
Unity.AI.Navigation.NavMeshSurface:UpdateNavMesh (UnityEngine.AI.NavMeshData) (at ./Library/PackageCache/com.unity.ai.navigation@1.1.5/Runtime/NavMeshSurface.cs:294)
Unity.AI.Navigation.Editor.NavMeshAssetManager:StartBakingSurfaces (UnityEngine.Object[ ]) (at ./Library/PackageCache/com.unity.ai.navigation@1.1.5/Editor/NavMeshAssetManager.cs:129)
Unity.AI.Navigation.Editor.NavMeshSurfaceEditor:OnInspectorGUI () (at ./Library/PackageCache/com.unity.ai.navigation@1.1.5/Editor/NavMeshSurfaceEditor.cs:302)
UnityEngine.GUIUtility: ProcessEvent (int,intptr,bool&)

I already searched for the problem and tried this to resolve, but without success:

  • Clearing Nav Mesh Data and baking again
  • Deactivating Static Batching
  • In “Use geometry”, switching from “Render Meshes” to “Physics Colliders”

How can I find out which vertex data is invalid so that I could remove it? :face_with_spiral_eyes: I have dozens of prefabs in the scene. Aside from this error, the whole scene works flawlessly but without a navmesh I cannot put traffic in it. Has anyone an advice?

is it the terrain itself have the problem? if it is flat anyway, replace that with a plane and try again

Thank you for your answer. In the meantime, I got the navmesh working and the terrain is ok, but I am still looking for the cause for the error message. A reference to the source mesh with the invalid vertex in the message would have been valueable.

EDIT: I just solved this, for me at least. My issue was that there were several empty PolyShape objects lying around my scene, which I found through the Hierarchy. Removing them instantly fixed my game.

Hey, how did you get the navmesh to work? I have this exact issue, also with countless gameobjects, and my game will not work at all at the moment due to this issue.

Well, in my case the Gizmo was deactivated by accident, and this was hiding not only the usual lines but the navmesh, too. So was navmesh was created but I just could not see it. As I activated the gizmo again, I was able the use all of the level in a normal way, even when the error message was present. So it seemed not to be as serious as I had assumed.
For the level is not very complex, I think the problem here could have its origin in an asset that does not work right for me anyway; I will remove it and see whether the message is gone then.