Hi, sorry pretty new to Unity but I'll try to explain what I am trying to do.
I am trying to create a grid of 3d cubes, say 30 cubes * 50 cubes. Eventually I want to develop it so when the mouse moves over the a cube in the grid it rotates. But thats not the issue at the moment.
So my question is, simply is there an easy way to create a grid of cubes instead of doing it by hand manually?
Akin to the array tool in Cinema4D and in Actionscript 3:
Thanks in advance.
*Mods if my Tags are wrong please amend.
If you want to create the cubes via code, it would probably look something like what you've posted (i.e. a single or double loop, with a cube created for every iteration). I can't really think of any alternate approach that would be simpler or more straightforward than that.
You could also create the grid by hand in the editor pretty quickly by copying and pasting (e.g. create one row and copy-and-paste it N times). Or, you could write an editor script to create the grid, after which the cubes would be saved with the scene (meaning you wouldn't have to re-create them in code each time the level was loaded).
answered Mar 17 '11 at 12:40 PM