Quantcast
Viewing latest article 1
Browse Latest Browse All 34

How to create a 3d grid of cubes

Hello. I am fairly new to unity3d, but have been coding with other programs for many years. I am not sure how to create a 3d grid of cubes (such as 10*10*10). What I want to do in the future is be able to make shapes out of the cubes by deleting some, or changing colors. But for now, I don't even know how to spawn the cubes 3d grid. I have started out by creating for loops like this: for(var z=0;z<8;z++) { for(var y=0;y<8;y++) { for(var x=0;x<8;x++) { //spawn cubes here }}} I have to clarify about how I spawn the cubes. I don't want to spawn thousands of different objects, because this will cause extreme lag. Instead,all I need to do is store each of the cubes data into a giant array. Please help lead me in the right direction. ps. I have looked all over the internet, and I have found examples if spawning a 3d grid of cubes. However, this is not what I need. I need this in "data" form, like an array. Then, hopefully, I can control what is rendering and prevent serious lag.

Viewing latest article 1
Browse Latest Browse All 34

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>