Ok, so I have made a cutscene in unity and I used this code;
var hold : int = 660; //Set this for how long your animation is
function Update () {
//Play animation
wait();
Application.LoadLevel(2); //Your scene
}
function wait () {
yield WaitForSeconds ((hold));
}
LightSource helped me, but it doesn’t play the cutscene, it just skips to the game! I am very much of a noob, so be easy on me. :3
Please help!
Scribe
March 29, 2013, 12:33am
3
Try something like this:
var hold = 660;
function Start () {
wait();
}
function wait () {
//play your cutscene here
yield WaitForSeconds(hold);
Application.LoadLevel(2);
}
Add the code to make your cutscene play where the comment is, I tested this with an audio clip and it worked, hopefully you have success!
Scribe
There’s no point to the wait function, since it just does WaitForSeconds. So, get rid of it and just use WaitForSeconds directly instead. You can’t make Update into a coroutine, so move any code that needs WaitForSeconds out of Update.