Hi
Ive been stuck on this for a while now, i have searched the web and forums and cant find an answer
When i use the code i found below it will put 1 extra cube into position but then adds like 50 GameObjects to my Hierarchy and i dont even use a loop?? btw i use javascript.
function Start () {
var original:GameObject = GameObject.Find("Cube");
//for(var i = 1;i<=5){
var cube:GameObject = Instantiate(original);
cube.transform.Translate(new Vector3(i,0,0));
// }
}
when i try to use the loop unity just crashes.
does anyone know what im doing wrong or have a better way of achieving this?
im attempting to make a flat grid of cubes, maybe 10 by 10 for now, where i can identify one by clicking on it. but trying to get the generation of cubes working first