Pimeko

Untitled

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