- Home /
Load Level after 5 Seconds
How can I make my level load after a delay of 5 seconds without pressing any button.
Felipe
Answer by Berenger · Feb 21, 2012 at 03:30 AM
Invoke( "Load", 5 );
function Load(){
LoadLevel(...);
}
Scene$$anonymous$$anager.LoadScene ins$$anonymous$$d of Application.LoadLevel for Unity 5.3.
The console is your friend, it tells you what to replace deprecated methods with.
i tested on 5.3 it worked put invoke where u want to start ti$$anonymous$$g
Answer by James Tima · Feb 21, 2012 at 08:40 AM
function LoadLevel (levelname : String)
{
yield WaitForSeconds(5);
Application.LoadLevel(levelname);
}
when u want to load level call this function like
LoadLevel("menu");
Answer by bhasker · Feb 23, 2012 at 11:18 PM
var timeLimit : float = 5; // 1 minute timer
Invoke("NextMap", timeLimit);
function NextMap() { Application.LoadLevel(Application.loadedLevel + 1); //current level is 1
}