hello, i know this is a noobie question but i cant figure it out, i have a loop script and when i try to run it unity crashes. it works fine with everything else its just this script. any help is appreciated
#pragma strict
var i:int=0;
var Prefab:GameObject;
var lastUpdate:float=0;
function Start () {
}
function Update () {
while(i<10){
print(i);
if(Time.time - lastUpdate >= 1f){
lastUpdate = Time.time;
i++;
Instantiate(Prefab,transform.position,transform.rotation);
}
}
}