Application.LoadLevel () reloads app instead of advancing to appropriate scene?

After much Googling and forum searching, I still haven’t found an answer to this one.

In Unity, my game works just fine. It goes back and forth between two scenes “Menu” and “Game” using UserPrefs to store data. Both are properly added in order under “Build Settings”. However, when I run the APK build on my Android Device, the “Game” scene doesn’t load. Instead the whole app just loads the initial “Menu” scene again, splash screen and all. Here’s the basics:

public static void GotoGame ()
{
SavePlayerPrefs ();
Application.LoadLevel (1);
}

Any ideas?

2 Answers

2

LoadLevel(1) will always load level 1… if you wish to just iterate through the levels you will have to do something like Application.LoadLevel(Application.loadedLevel +1);

Or you can do it through a string, I always found it easier to do that…

Application.LoadLevel ("Level_1");

“Level_1” is the string, put whatever you level save is called into the quotes.