Hello I am woundering how would I create a plane of cubes using an array like a grid of 100x100 cubes?
1 Answer
1Found the answer:
var prefab : GameObject;
var x = 100;
var z = 100;
function Start () {
for (i = 0; i < x; i++) {
for (j = 0; j < z; j++) {
Instantiate(prefab, Vector3(i, 0, j), Quaternion.identity);
}
}
}
Thanks, i've been looking 2 days for an easy solution for this problem myself and this is the first one that actually worked!!
– chrisstar123