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
- Particle System only collides with one Terrain Collider at a time when Collision Type is set to 'World'
- Editor crashes on StoredGraphicsBuffer::GetGfxBufferID when VFX Graph property is modified during Play Mode and Application.targetFrameRate is used to limit FPS
- Crash on NVAPI_Thunk when changing Player resolution while HDR display is used and Direct3D12 is set as the graphics API
- Only one out of multiple cameras is shown in the Play Mode while HDR display is used and Direct3D12 is set as the graphics API
- The "Paste Component as New" option is incorrectly displayed as active despite the action being prohibited
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");