Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vector3 currentPosition = new Vector3(0, 0, 0);
- for (int x = 0; x < width; x++)
- {
- for (int y = 0; y < height; y++)
- {
- var instance = Instantiate(tilePrefab);
- instance.transform.position = currentPosition;
- currentPosition += new Vector3(instance.transform.localScale.x, 0, instance.transform.localScale.z);
- }
- currentPosition.x = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement