Search Unity

NavMeshSurface, cannot bake at runtime?

Discussion in 'Navigation' started by Xhitman, Jan 26, 2020.

  1. Xhitman

    Xhitman

    Joined:
    Oct 30, 2015
    Posts:
    452
    RuntimeNavMeshBuilder: Source mesh Map_10x10 does not allow read access. This will work in playmode in the editor but not in player
    UnityEngine.AI.NavMeshSurface:BuildNavMesh()

    Code (CSharp):
    1. GameObject cb = Instantiate(Resources.Load(GetResourcesPath(mapLayout.ChessBoardName)), Vector3.zero, transform.rotation) as GameObject;
    2.         NavMeshSurface nm = cb.GetComponent<NavMeshSurface>();      
    3.         nm.BuildNavMesh();
     
  2. Xhitman

    Xhitman

    Joined:
    Oct 30, 2015
    Posts:
    452