- Home /
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
{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.
Answer by Chris D · Jun 29, 2011 at 08:46 PM
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.
Your answer
Follow this Question
Related Questions
Small line appears on tilebased terrain 1 Answer
Get Tile object from Tilemap instead of TileBase 2 Answers
Tilemap: Place or Destroy Tiles at Mouse Position 2 Answers
TILE MOVEMENT 0 Answers
Unity 2D TileMap Rule Tile Carpet 1 Answer