Im currently working on a little proje, I’m trying to make a system where each “map” (collection of prefabs, lights etc) dont have to be built into a scene to be accessed, rather loaded from a file into a blank scene at run time. So far I have it able to create them using
maps = gameObject.GetComponent<mapManager>();
int max = maps.mapList.Count;
int mapNum = UnityEngine.Random.Range(1, max);
Map newMap = maps.mapList[mapNum];
UnityEngine.Object[] mapObjects = maps.loadMapObjects(mapNum);
foreach(UnityEngine.Object tObj in mapObjects )
{
Debug.Log(tObj.name);
Instantiate(tObj);
}
Now this appears to work fine, but I need things such as the navmesh to be created alongside it… i have managed to take a “navmesh.asset” from taking the map into a blank scene, baking a navmesh and then taking the navmesh to where I needed it from the folder unity put it in after baking, but how would I then “insert” this pre-baked navmash into the blank scene?