- Home /
Application.LoadLevel Strange Problem
Hi guys! i've got a strange problem with Application.LoadLevel(Application.loadedLevel).... When i load the level in windows the level restart normally, but when the scene restart in android it doesn't work... beacuse all object are named Deleted Object... i don't understand... Can someone help me please? this is the code in void Update:
bool Ricomincia_premuto = CrossPlatformInputManager.GetButton("Bottone_ricomincia");
if (Ricomincia_premuto == true) {
Application.LoadLevel(Application.loadedLevel);
}
Application.LoadLevel is now obsolete. Use Scene$$anonymous$$anager.LoadScene ins$$anonymous$$d.
Answer by figone2000 · Jan 20, 2016 at 08:14 PM
Ok, i've fixed it changing .GetButon with .GetButonUp... I tryed random and it works xD
Answer by LuisCRSousa · Jan 20, 2016 at 03:56 PM
Be sure you add the level you want to load in your build settings : Load the scene in the editor then in Edit->Build Settings : click on "Add Current"
Maybe you did this on WIndows Mode, but not when you change it to Android.
But isn't loadedLevel the level that was previously loaded? How can that not be in the build?
You are right..
Are you using Unity 5x? You can use this new feature. Scene$$anonymous$$anager.LoadScene (Scene$$anonymous$$anager.GetActiveScene ().name);
in the meantime, thank you for the the reply! But i'm using Unity 5.2 and when i use Scene$$anonymous$$anager it tells me that it doesn't exist xD do you advise to update unity and retry?