- Home /
Question by
mustang4484 · Jun 23, 2019 at 01:34 PM ·
arrayarray of gameobjects
Array along on Z axis and along X axis.
Hi guys
I've an array of gameobjects along Z axis, and i would like that foreach gameobject instantiate on Z there is an array of gameobject on X axis.
I don't know if use foreach inside the first instantiate.
Any suggestion?
void spawn()
{
Vector3 pos = center + new Vector3(Random.Range(-size.x , size.x),Random.Range(-15,-25) , Random.Range(size.z , size.z / 2));
CuboCount = Instantiate(cuboprefab, pos, randomRotation) as GameObject;
Destroy(CuboCount, 30f);
}
Comment