How to bake navmesh at runtime

Hi, I need to bake the navmesh at runtime as my gameworld is randomly generated.

This was working very well historically using the navmesh surface component from github and:

public NavMeshSurface surface;
surface.BuildNavMesh();

But I started haveing some issues; I removed the navmesh surface component from github and replaced by the new AI Navigation package. But i can’t make it work anymore.

As you can tell, I’m very new / bad at unity an would appreciate any help you can offer; my searches online have been unsuccessful so far hence this post.

Thanks!

2 Likes

It might be solved by upgrading the editor to 2022.8
they have released a new version of the AI tools integrated into unity core

Update: I have done this upgrade and (after a bit of fiddling around) discovered that NavMeshSurface is not under the UnityEngine.AI namespace but under the Unity.AI.Navigation namespace. Do that and things operate much as before.

1 Like