Search Issue Tracker
Fixed in 5.5.0
Votes
15
Found in
5.3.1p3
Issue ID
762371
Regression
No
Unity Hangs on SceneManager.UnloadScene
Reproduction steps:
1. Open the scene "Spoke Room 00"
2. Make the cube collide with the sphere one time.
3. Make the cube collide a second time with the sphere (the trigger is launched OnTriggerEnter). The Editor hangs in this point.
Reproducible: 5.4.0b2, 5.3.1p3
Comments (4)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Crash on ResizeScriptingList<ScriptingObjectPtr> when passing an undeclared variable to the results parameter for GameObject.FindGameObjectsWithTag
- [Android] "Screen.safeArea.y" always returns values outside of the Safe Area when the device is in Portrait orientation
- Frame spike due to many TreeRenderer.TreeUpdated calls when repositioning terrains in large Scenes
- Crash on GameObject::RemoveComponentFromGameObjectInternal when reparenting Text GameObjects
- [IL2CPP-GarbageCollector] Changing GCMode might permanently disable GC in a multithreaded context
Johannski
Oct 05, 2016 07:29
Also reproducible in 5.4.1f1, but the workaround mentioned by Lassade still works. So you have to wait to the end of the frame otherwise the GameObject destroy immediate calls will create problems in the physics.
yield return new WaitForEndOfFrame();
SceneManager.UnloadScene("MyScene");
Lukas Brunner
May 17, 2016 00:22
I had exactly the same issue when exiting playmode. In play mode i load another scene additively which means that if a exit playmode it will be unloaded by the editor automatically (just a wild guess but I think its technically the same thing).
The interesting thing:
I have a canvas in my loaded scene, if I remove that canvas everything is fine again. So maybe it is due to a bug with the canvas?
Can you guys eventually confim that?
TSRajesh
Mar 27, 2016 18:54
I do wait some time (yield return new WaitForSeconds(1.0f) ).. But still, hangs on unloadscene.
Works OK in Editor. But Crashes in Built exe. (Win x86).
(One thing I noticed is.. It happens if I first change active scene.. And then unload the just-deactivated scene. Even If i yield-wait for few seconds in between)
Currently on 5.4.3p1
lassade
Mar 25, 2016 18:32
I found i way around this, instead os just calling UnloadScene, create a coroutine that when the trigger recives a on enter event wait for the end of frame then unload the scene.
Like this:
yield return new WaitForEndOfFrame();
SceneManager.UnloadScene("MyScene");