- Home /
Question by
msakkuzu · Sep 17, 2017 at 01:50 PM ·
load scene
Unity SceneManager.LoadScene quits application
I have two different scenes one is named 'main' and the other 'game' both are added Scenes In Load. When I use SceneManager.LoadScene("game"); works with no problem but when I tried to return to main scene with that code
if (Input.GetKeyDown (KeyCode.Escape)) { SceneManager.LoadScene("main"); } strangely the game quits. Thanks.
Comment
Best Answer
Answer by msakkuzu · Sep 17, 2017 at 04:38 PM
Sorry for the interruption. Somewhere on an other script I found that code. if (Input.GetKeyDown (KeyCode.Escape)) { Application.Quit (); } That's my bad, I know...
We've all been there ;) This embarrassment is why I now always test a problem in a new scene or project before posting, using the absolute $$anonymous$$imum to duplicate the issue.
Your answer