- Home /
Load Level Script has stopped working
In my game there is a loading screen that uses a PlayerPref to either load the tutorial or the title screen, depending on if it is your first play. It was working fine, until I added a new scene in the build setting before it, and now it's stopped completley. Any ideas? Here the code if it helps:
#pragma strict
var newskin : GUISkin;
function Start()
{
yield WaitForSeconds(3);
if(PlayerPrefs.HasKey("savedLevel")){
// there is a saved level, load that one
Application.LoadLevel(PlayerPrefs.GetInt("savedLevel"));
}else{
// no saved level, load the first one
Application.LoadLevel(3);
}
}
function OnGUI () {
GUI.skin = newskin;
GUI.color = Color.black;
GUI.Label (Rect (635, 650, 500, 500), "Loading...");
}
Just a side note: Turning the level before the loading level off in the build menu fixes the problem, but I still want that one to be first. :(
What does it do now? Nothing at all? Only load the Tutorial/TitleScreen?
Answer by Robo_Chiz · Jun 29, 2012 at 08:09 PM
I've figured it out now. There was another script that sets the PlayerPref, that I forget to change to the new layout. Opps
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
I made a better shader how do i fix[add _Shadow Strength]help???>Sorry that im asking for to much 1 Answer
Help In Making a SphereCast for 3D Tire! Working RayCast Script included! 0 Answers
How to put seperate scenes together into one game 1 Answer
connect to hosted level 0 Answers