- Home /
The question is answered, right answer was accepted
LoadScene.Single don't close the current scene
Hello everybody ! I 'm a beginner in unity, and i try to create a menu to switch between scenes. But when i switch, i can see in the background the last scene.
The background camera is a solid color in all scenes. I don't understand why because i use LoadScene.Single to close all others scenes. Before the switch : After the switch : Can anybody help me to find a solution please ? Thank's.
Is this a different scene or is it a different ui element? Could we see a screenshot of your Hierarchy to see if its somehow being carried over into the next scene.
It's a new scene. This is the hierarchy for the first scene. This is the hierarchy for the second scene.
The gameobject that i don't show are just container for input field and label. I use a gameobject tabmenu to display menu on all scenes.
Answer by umadgen_unity · Dec 28, 2018 at 07:16 PM
Solution found : I had a singleton attached to each main gameObject. I write DontDestroyOnLoad on the function Awake on my singleton. So i remove the singleton on each gameobject, and i put a gameobject with my singleton.
Follow this Question
Related Questions
Loading screen with long-running CPU-heavy Awake() 1 Answer
How to prevent a script from running until the scene is loaded? 2 Answers
Can't find game object / script after scene re-enter 1 Answer
How do I return scene using bulid index scenemanager in c# 3 Answers
Wierd problem when reloading scene, public gameobject does not get assigned... 0 Answers