I am creating a game that allows players to draw individual rooms on a 100x100 grid. The grid is visible when they draw their rooms as well as during the game play. The rooms can be irregular shapes but each 1x1 grid tile can not be divided. 1 tile, 1 space and any number of tiles to make up the room.
[116927-floortiles.jpg*_|116927]
I am running a function afterwards to automatically place walls between different rooms. I am currently running through the following command to draw each cube. The result is 10,000 cubes though. If I hide the entire set of cubes my fps is over 70. If I make them visible it’s more like 40 odd.
for(int i = 0; i < floorTiles.Count; i++) {
GameObject newTile = Instantiate(blankTile,new Vector3(floorTiles_.x,0,floorTiles*.y),transform.rotation,floor.transform);*_
}
The Instantiate part isn’t running slow at all - it’s quite quick. But the visual rendering of so many cubes seems to weigh Unity down too much. I am sure that I am just missing the concept somewhere of how to make this work and my best efforts of trying to find the answer online lead me more towards 2d projects.
So my question is what is the correct way to create individual floor tiles in a 3d game.
_*