- Home /
Question by
zadeh79 · Dec 09, 2019 at 02:41 PM ·
scene-loadingscene change
Scenemanager not loading scene
For some reason I can't get my scene to load from another scene. I have the scene worldrecordscene added to build settings, but its not loading for some reason. Instead it loads normalscene. The conditional is returning TRUE. Please help.
if (scene1234.name == "worldrecordmode") //**tested with Debug.log and it returns TRUE**
{
SceneManager.LoadScene("worldrecordscene");
}
SceneManager.LoadScene("normalscene");
}
Comment
Best Answer
Answer by Larry-Dietz · Dec 09, 2019 at 02:50 PM
You code continues to complete the current method, so after telling it lo load the world scene, you then immediately tell it to load the normal scene.
Change your if statement to
if (scene1234.name == "worldrecordmode")
SceneManager.LoadScene("worldrecordscene");
else
SceneManager.LoadScene("normalscene");
That should fix you up. -Larry
Your answer
