- Home /
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?
Answer by Anxo · Oct 06, 2014 at 03:28 PM
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);
Answer by N1warhead · Oct 06, 2014 at 03:32 PM
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.
Your answer
![](https://koobas.hobune.stream/wayback/20220613164515im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
my android build is of 29mb but when i install it ,size become 50mb in device 0 Answers
Android dev - APK builder failed 0 Answers
Error build android app 1 Answer
Android - Design your app for tablets optimization tip on Google Play 0 Answers
Why doesn't my scene update when deploying to Android? 4 Answers