Preparing a scene for Runtime Navmesh Baking

There are a couple of things to be aware of when setting up a scene for runtime navmesh baking.

Note: these are restrictions imposed by Unity’s implementation of runtime navmesh baking in general, not a limitation of this package (we simply use the APIs provided by Unity).

“Source Mesh XXX does not allow read access” errors

If you try to use the Nav Mesh Baker without changing anything in your scene, you may encounter errors like “Source mesh XXX does not allow read access.”

There are a few things potentially causing this:

  1. Your NavmeshSurface is set to use ‘Render Geometry’ - in order to determine what to bake, the NavmeshBaker needs access to the geometry in your scene.

    1. By default, the NavmeshBaker sets the NavmeshSurface to use Physics Colliders, however you can also choose Render Geometry if you wish.

  2. You are using Mesh Colliders - same as above, in order to generate the navmesh from the mesh info, the NavmeshBaker requires access to the geometry.

  3. You have meshes in your scene combined at runtime via the ‘Batching Static’ option. Unfortunately if you use Unity’s batching system, the resulting mesh is not readable, which prevents the NavmeshBaker from accessing the geometry as well.

Continue reading for solutions to these issues.

Last updated