Search Issue Tracker
Fixed in 5.6.0
Unloading Scene destroys runtime created objects, when the same scene has been loaded multiple times additively
1. Open project that i attached "unloadScene.zip"
2. Open "TestCase1" scene, and play it.
3. Look at the Hierarchy. "TestObject" got destroyed, only "SCENE obj" is left.
4. Stop the "Play mode".
5. In "TestCase1" select "Script" object in Hierarchy. In "Test Script" component, "Scene 2 Name" change from "EmptyScene1" to "EmptyScene2".
6. Play scene again.
7. In hierarchy "TestObject" is not destroyed.
Actual result: When multiple copies of the same scene are loaded using "LoadSceneAsync" and one of them is unloaded using "UnloadSceneAsync" or "UnloadScene", it also destroys runtime created objects.
Expected result: When "UnloadSceneAsync", or "UnloadScene" is called, it only destroys objects which were associated with that scene.
//Reproduces when game object is created with "new GameObject", or with "Instantiate".
Reproduced with: 5.5.0f3, 5.6.0b1
Not reproduced with: 5.4.2f1 //In 5.4 there was only "UnloadScene" but not "UnloadSceneAsync", although the description is the same.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- [Android] Can't relocate the caret in Input Fields when Hide Mobile Input option is being used
- Multiple Edge Colliders 2D can be edited at the same time, every Edge Collider's "Edit Collider" button is highlighted
- Crash on SceneVisibilityState when trying to open a project containing another project in the Assets folder
- Reflection probe bounces don't work when Rendering Path is set to 'Deferred'
- Shader error undeclared identifier "UNITY_TRANSFER_LIGHTING" when building project