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
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
- Mouse inputs cannot be inputted when searching the Shortcuts Menu by type "Shortcut"
- "Debug Assertion Failed!" error when launching Windows Dedicated Server Player with Script Debugging enabled
- [Cinematic Studio][3D HDRP] Shader warnings thrown in the Console window when creating a new project with Cinematic Studio template
- Autoplay is triggered on Audio Assets when changing Asset Bundle tags
- Inspector Asset Bundle section has no indication for Variants, AssetBundle is written without a space, and Variant dropdown menu is available without setting the Asset Bundle first
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");