Simple tile engine/map?

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


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.

  1. create your array
  2. loop through the array → for(int i in cubeArray){...
  3. instantiate a cube at the selected location
  4. increment the location coordinates according to whatever logic you want
  5. repeat until your map is created.