public class GenerateMap : MonoBehaviour { public GameObject[] Blocks; void Start() { for (int i = 0; i < 20; i++) { for (int j = 0; j < 20; j++) { float Zed = Blocks[0].transform.position.z + j; Instantiate(Blocks[0], new Vector3(Blocks[0].transform.position.x + i, Blocks[0].transform.position.y, Zed), new Quaternion(0, 0, 0, 0)); } } for (float a = 0; a < 20; a++) { float DownY = Blocks[1].transform.position.y - a - 1; for (int i = 0; i < 20; i++) { for (int j = 0; j < 20; j++) { float Zed = Blocks[1].transform.position.z + j; Instantiate(Blocks[1], new Vector3(Blocks[1].transform.position.x + i, DownY, Zed), new Quaternion(0, 0, 0, 0)); } } } } }