Instantiating game objects in spiral pattern
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:
Comment
Your answer
Follow this Question
Related Questions
On which side of the vector on graph is the origin? [Geometry] 1 Answer
Calculate the new coordinates of points after the plane of the points is transformed 1 Answer
Approach for filling 6x6 matrix with shapes 2 Answers
how to calculate the angle between two vectors? 6 Answers
[SOLVED]Unexpected results 0 Answers