Advertisement
Pimeko

Untitled

Oct 26th, 2020
821
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.37 KB | None | 0 0
  1. Vector3 currentPosition = new Vector3(0, 0, 0);
  2.  
  3. for (int x = 0; x < width; x++)
  4. {
  5.     for (int y = 0; y < height; y++)
  6.     {
  7.         var instance = Instantiate(tilePrefab);
  8.         instance.transform.position = currentPosition;
  9.         currentPosition += new Vector3(instance.transform.localScale.x, 0, instance.transform.localScale.z);
  10.     }
  11.     currentPosition.x = 0;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement