- Home /
Go to other scene
Hi everyone.
I have the playscene. and if you attach something, you will go to a scene without nothing. The whole scene is empty without an object except the main camera. But now my question is. I want to give my camera in the empty scene a JS that will go to an other scene after 3 seconds.
In short summary: If you are in a scene. You need to go to an other scene without doing anything. It goes automatically to an other scene after 3 seconds.
How to do this in JS?
i searched for it, but i don't know what kind of timer i should use.
it's like this
function Start () {
if (the timer should come here + 3.0 sec){
Application.LoadLevel (1);
}
}
Can you help me?
Check out this question for a very nice timer example. If you don't understand what the code on that page is doing, take a look at the documentation for each of the functions; it's generally pretty explicit.
Answer by fireDude67 · Jul 09, 2011 at 12:52 AM
Think I saw this from some tutorial. Correct me if I'm wrong:
function Start() {
yield WaitForSeconds(3);
Application.LoadLevel("LevelTwo");
}
@fireDude67 Nope, that's not working.
I figured it out. It's
function Start() {
yield WaitForSeconds(3);
Application.LoadLevel(1);
}
Your answer
Follow this Question
Related Questions
How to load a level after 30 seconds? 3 Answers
Shift from one scene to another (based on time) 1 Answer
Help with time.time when new scene starts. 1 Answer
Checking the scene/Level you are? 2 Answers