[ad_1]
My code generates a degree by looping by means of a listing of empty sport objects and selecting a random object from one other checklist of objects, then instantiating that object on the empty object’s place. Then I name BuildNavMesh
on my navmesh floor and it offers me this error:
RuntimeNavMeshBuilder: Source mesh Buildings doesn’t permit learn entry. This will work in playmode within the editor however not in participant
- UnityEngine.AI.NavMeshBuilder:BuildNavMeshData (UnityEngine.AI.NavMeshBuildSettings,System.Collections.Generic.List`1<UnityEngine.AI.NavMeshBuildSource>,UnityEngine.Bounds,UnityEngine.Vector3,UnityEngine.Quaternion)
- Unity.AI.Navigation.NavMeshSurface:BuildNavMesh () (at Library/PackageCache/com.unity.ai.navigation@1.0.0-exp.4/Runtime/NavMeshSurface.cs:251)
- CityGenerator:Start () (at Assets/CityGenerator.cs:19)
This is the code:
public List<GameObject> cityChunks;
int cityChunk;
public List<GameObject> grid;
public NavMeshSurface floor;
void Start()
{
foreach (GameObject empty in grid)
{
cityChunk = Random.Range(0, cityChunks.Count);
Instantiate(cityChunks[cityChunk], empty.remodel.place, Quaternion.identification);
}
floor.BuildNavMesh();
}
[ad_2]