Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var thePrefab : GameObject;
  2.  
  3. function Start () {
  4.  
  5.     var floorArray : Array = new Array(10);
  6.    
  7.     for (var x = 0; x < 10; x++) {
  8.        
  9.         if (!floorArray[x]) {  // this check is probably pointless
  10.             floorArray[x] = new Array(10);
  11.         }
  12.        
  13.         for (var z = 0; z < 10; z++) {
  14.        
  15.             var instance : GameObject = Instantiate(thePrefab, transform.position, transform.rotation);
  16.             var y = 0.5;
  17.             instance.transform.position = Vector3(x, y, z);
  18.             floorArray[x][y] = instance;
  19.        
  20.         }
  21.        
  22.     }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement