-
-
Save Gojeflone/9043694 to your computer and use it in GitHub Desktop.
Putting a pause in a script by using "WaitforSeconds"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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