How to update Navmesh at runtime in ECS/DOTS?

Hi everyone!
I am working on an ECS/DOTS game that builds the levels at runtime, in a procedural fashion.
This includes adding walls, slopes, and hills.
Thus I need to rebuild the Navmesh once per level load after those Entities are instantiated.

However, ECS currently doesn’t seem to support Navmesh modification at runtime. The methods available in NavmeshSurface have no impact on Entities; they just impact regular Game Objects.

I am looking for alternatives here. Is it even accomplishable without having to create a whole new custom Navmesh system?

The plan B I have is to have tiny modules, with NavmeshSurfaces already baked, and spawn them to assemble the bigger level. This option would require me to figure out how to connect those tiny navmeshes, however, and I have not explored how feasible that is.

Any joy with this?

You can use the NavMeshBuildSource API at NavMeshBuild Source API URL

I am currently revamping my code to this because I’m currently using invisible gameObjects just for navmesh baking. Here’s my workflow:

  1. Generate what you need using the ECS entities
  2. Then collect all that mesh and transform data from the entities
  3. send that data to a NavMeshSurface.BuildNavMesh() on the invisible (but temporary) GameObjects.

But now I am moving into just sending that data to the API since I can bake without any gameobjects.

BTW your pre-baked NavMesh might be an interesting idea to test but It might misbehave on organic terrains.