When i generate a buildings city i’m getting the exception.
In the Hierarchy all the objects Tile_ and Terrain_ should be children under another GameObject.
It was working fine before i when i created just cubes using CreatePrimivitbe:
prefab = GameObject.CreatePrimitive(PrimitiveType.Cube);
But now i’m using Instantiate:
prefab = map.Prefab;
Instantiate(prefab);
And when using Instantiate i’m getting the exception on the line:
prefab.transform.parent = map.transform;
Setting the parent of a transform which resides in a prefab is disabled to prevent data corruption
What can i do to solve it ?