- Home /
Level requested not loading, prev. one is instead?
Ok, so here is my script, its on a trigger. When I hit said Trigger, scene 1 (the one I'm on) then loads up again, instead of scene 2. I have no other scripts with LoadLevel on them in the area.... Any ideas?? And I double checked the "build settings" and made sure.
#pragma strict
function Start() {
}
function OnTriggerEnter(){
yield WaitForSeconds(2); Application.LoadLevel(2);
}
I'm a dork. The problem was strange and I didn't think it would have been a problem. The scene I was 'in' before trying to load 2 wasn't in my build settings because I re-named it,(the old one was though) so for some reason it was loading the current scene by the other name. But it was scene 1 not 2 so that still wouldn't make sense. I would still think it would load whatever level was on the trigger... But I guess its picky. Thanks for the quick response though!!!!
Hey, just so you know, you can also load scenes by their name, ins$$anonymous$$d of their "scene number". Happy creating! :D
Answer by gamegirl1984 · Dec 06, 2014 at 01:17 PM
Close this please. I'm a dork. the issues was: My current scene was not in my build settings (because I re-named it) So for some reason that was effecting the trigger script. And it was re loading the current scene under a different name. Not sure why and how that would happen though.
Answer by jtok4j · Dec 06, 2014 at 01:12 PM
Hey Gamegirl,
Sure you're not in scene 0 (The real scene 1) and needing to load scene 1? Have you tried messing with the 2 and changing it to something else?
If this doesn't help, can you please put a screenshot of your build settings? (Sorry. :P ) Hope to hear from you soon! :D
Your answer
Follow this Question
Related Questions
Load next level when reach score 1 Answer
destroy object after Application.LoadLevel 1 Answer
Can't click gameobject when over another trigger? 1 Answer
enable a canvas on trigger 2 Answers
Level Segmenting and Loading 1 Answer