This is a script that is supposed to create the floor around the player if there is not a block there already but it freezes up unity
#pragma strict
var X : int;
var Y : int;
var Z : int;
var grassBlock : GameObject;
var hill : GameObject;
function Start()
{
while(1)
{
for(var i=(X-64) ; i<(X+64) ; i++)
{
for(var j=(Z-64) ; j<(Z+64) ; j++)
{
if (!(Physics.Raycast (Vector3(i,0,j+2), Vector3.back, 2 )))
{
Instantiate (grassBlock, Vector3(i,0,j), Quaternion.identity);
}
}
}
yield;
}
}
function Update ()
{
X = transform.position.x;
Z = transform.position.z;
}