system
1
Create two primitive cube prefabs one red one green
put them in an array as a value 1=red 2=green
create a map of 1s and 2s to represent the map made out of the cubes
{11111222
11111221
11122211}
initiate the creation of the map at level start.
anyone know of a tutorial or guide on doing this. I searched for this but couldn’t anything.
You’ve written the outline of exactly what you need to do, you just need to put the right functions in a script.
- create your array
- loop through the array →
for(int i in cubeArray){...
-
instantiate a cube at the selected location
- increment the location coordinates according to whatever logic you want
- repeat until your map is created.