Search Unity

Question I can no longer reference NavMeshSurface

Discussion in 'Navigation' started by AcidmanRPGz, Feb 12, 2024.

  1. AcidmanRPGz

    AcidmanRPGz

    Joined:
    Feb 14, 2020
    Posts:
    10
    My game randomly selects arenas for the player to fight in. I decided to go back and update the game, and updated the engine from 2021 to 2022. However, that means that the script responsible for building the NavMeshSurface during runtime no longer works, as it cannot reference the NavMeshSurface component. Is there either another way to do it, or a workaround for this problem?

    The relevant code in question is this:

    Code (CSharp):
    1.  public NavMeshSurface surface;
    When I need to build the new navmesh:
    Code (CSharp):
    1. surface.RemoveData();
    2. surface.BuildNavMesh();