Skip to content

Instantly share code, notes, and snippets.

@Gojeflone
Created February 17, 2014 02:29
Show Gist options
  • Save Gojeflone/9043694 to your computer and use it in GitHub Desktop.
Save Gojeflone/9043694 to your computer and use it in GitHub Desktop.
Putting a pause in a script by using "WaitforSeconds"
var box : GameObject;
var readynow : boolean = true;
function Update () {
if(readynow){
MakeBox();
}
}
function MakeBox(){
readynow=false;
Instantiate(box, transform.position, transform.rotation);
yield WaitForSeconds(2);
readynow=true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment