Did navmesh change with unity 2020 LTS? NavMeshBuilder.BuildNavMesh issue.

Hi All,

Playing around with a procedural generated dungeon, and need navmesh after generation.
Recently i started using 2020LTS and found NavMeshBuilder.BuildNavMesh is not a thing anymore.

so when i

Using Unityengine.AI;

I can only use BuildNavMeshData now…
7086196--843562--upload_2021-4-28_15-2-3.png

No usefull information found in the documentation… Any ideas?

Unity Documentation:

BuildNavMesh is only available in the UnityEditor:

if you have “using UnityEditor;” as well it should show up for you

So does this mean NavMeshBuilder isn’t something that will function at runtime?

Working on something with procedural levels (and Bolt Scripting) and all the bits and pieces seem to be there, but I can’t seem to get any of it to work :confused:

Edit: I was doing some digging and it looks like you need to use an external package? NavmeshComponents?

https://github.com/Unity-Technologies/NavMeshComponents

No, you can use NavMeshBuilder at runtime, there are just some methods, like BuildNavMesh, that are not available at Runtime. You can see AI Series Part 14 for how you can use NavMeshBuilder at Runtime.

NavMeshComponents are a set of helpful tools that improve your NavMesh working experience, but I don’t think they’re required for NavMeshBuilder.

I see.

So in my case where I generate a level with static pre-fab rooms, the best approach would be to use NavMeshBuilder?

If it’s generated at runtime, yes I would use NavMeshBuilder.

To achieve that you’d register some NavMeshData with the NavMesh, then use the NavMeshBuilder to update the NavMeshData you registered and the NavMesh will update

1 Like

Makes sense.

I did find another solution using Navmesh Components. If you get the package, you can simply attach the NavMeshSurface component, bake the NavMesh in the prefab (although it’s important to note the PreFab won’t show the baked NV for some reason)

from there I just of run my map builder algorithm and the PF’s come with the NV’s ready to go.

I wonder why it’s still a preview package, as it seems to work quite reliably.

1 Like