I am trying to create grid tiles for a system in my game and without the proper algorithm right now it just starts spawning them from the bottom left side.
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
Transform tile = Instantiate(this.tile.transform, new Vector2(x, y), Quaternion.identity);
tile.parent = transform;
}
}
How can I make them spawn like this:
![alt text][1]
[1]: https://i.stack.imgur.com/kjR4H.png
↧