Unity keeps references to old scene when loading a scene
So i have made a nice editor for making tilemaps but today i noticed a bug in my editor. When i load a scene it keeps the references to the old scene which leads to alot of errors. This happens even when loading the same scene.
But when i just start unity up and that scene gets loaded it works fine. The serialization part also seems to work fine when i go into playmode and back.
What is the proper way to fix this?
Answer by KaOzz · Jan 02, 2016 at 06:14 PM
Same issue here. I have a "main_menu" scene. I worked on that scene. And everything its ok if I run the scene directly. But, if I hit Play in another scene, and run SceneManager.LoadScene("main_menu");, Unity load an old version of my "main_menu" scene. Weird. I checked that main_menu is my only scene on the project.
Your answer
![](https://koobas.hobune.stream/wayback/20220612053923im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
garbage collection in between scene changes? 2 Answers
Access render settings of other loaded scenes 0 Answers
how to load scenes so that my location is saved 0 Answers
Scene created from a script gives an error when tried to load 1 Answer
Build & run apk freezes on pushing content, only one scene of game available 1 Answer