ok so I’m relatively new to Unity3D. I made a worminator game (from the tornado twins tutorial) and I’ve fixed a lot of bugs I had with it before (like spawning halfway off the map when you die), but one still eludes me and it doesn’t seem to be a coding problem (although it may be, but I figured it’d be best to post this here).
basically, I have a splash page, a first level, and a second level. Going from the splash page, I can load up level one just fine and play through it just fine. Then when I beat it it’s suppose to load up level 2, but when it does it bugs out and says this and that doesn’t have an object, something about there not being a reference. I can’t seem to figure out why this is, because if I go to play the scene on its own it works 100% fine.
Can anyone figure this out maybe?
Also, just tried something out (making it so when I beat the second level it goes to splash page). When I did it went and worked but when I tried to reload level 1 it bugged out like on the first load of level 2. Could it have something to do with my script not loading correctly? What I mean is, now that I’ve set the below variable next_level to 0 (the index of my splash screen) in the hierarchy panel, when I beat level 1 it loads up level 2 then instantly loads the splash screen, if I try to load level one after that it bugs out like level 2 does and instantly loads level 2 and then the splash screen.
static var turret_number = 1;
var next_level = 2;
function Update(){
if(turret_number == 0){
Application.LoadLevel(next_level);
}
}
Edit: oh yeah and none of my scripts have DontDestroyOnLoad on them if that helps any.