Search Unity

Question How to bake navmesh at runtime

Discussion in 'Navigation' started by Articnos, Jan 28, 2023.

  1. Articnos

    Articnos

    Joined:
    Oct 31, 2016
    Posts:
    5
    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!
     
    WakingDragon and Brother_help like this.
  2. WakingDragon

    WakingDragon

    Joined:
    Mar 18, 2018
    Posts:
    41
    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.
     
    Last edited: Feb 24, 2023
    ElevenGame likes this.