- Home /
Question by
aidangig56 · Mar 01, 2014 at 11:28 AM ·
scenetimelevelyield
Change Scene after time?
I have been trying to change the scene after a certain by using yield waitforseconds, and application load level to get the job done. But it gives this error " It is not possible to invoke an expression of type 'int'.
function Start () { Application.loadedLevel ("Main Menu"); yield WaitForSeconds (5);
}
Comment
I'm not even sure if it's possible to use yield in start function but try replacing 5 to 5f.
Answer by fafase · Mar 01, 2014 at 12:43 PM
You are using the wrong method and in a wrong way. First it is
Application.LoadLevel("name");
Second you want to wait and do while now you are doing and wait.
function Start(){
yield WaitForSeconds(5);
Application.LoadLevel("name");
}
IEnumerator Start(){
yield WaitForSeconds(5);
Scene$$anonymous$$anagement.Scene$$anonymous$$anager.LoadScene("name");
}