Hi, I have been experiencing this issue for quite some time now. The editor will freeze up completely requiring a force close when loading/unloading scenes. Observations: - More complex scene are more likely to freeze the editor. - For some scenes the freeze will not occur every time, for others it happens 99% of the time. - It does not freeze or cause any problems in build. This is really affecting our productivity as we either have to preload our many scenes in the hierarchy before playing or have to build each time to run a test Our project is pretty sizeable (50GB). How can we get this solved? Thanks, Jake
The number of GameObjects and Components in a Scene have a significant impact on the time the editor needs to open and save a scene, as well as entering and leaving play-mode. I did various tests a while ago, the results can be seen here: https://forum.unity.com/threads/5-6...e-of-open-savescene-and-enterplaymode.447500/ The conclusion is that the Unity editor does not scale with complex scenes. Where "complex" refers to the number of Objects in such scene. Unity confirmed the problem, but nothing happened since then: https://issuetracker.unity3d.com/issues/non-linear-editor-performance-of-savescene-and-enterplaymode While I was trying to find a workaround to manage really complex scenes, I tried to split that scene into several hundreds smaller scenes and load/unload those smaller scenes on demand in the editor. This actually did work, but I ran into another issue with Unity. That is the editor does not support async-loading: https://issuetracker.unity3d.com/is...-the-loading-scenes-with-a-lot-of-gameobjects The result was few milliseconds freezes while navigating the scene view and a new scene needed to be loaded. This caused the scene camera to go completely crazy for example, not usable in production. I doubt they're going to fix either of these issues anytime soon, if ever at all.
@Peter77 thank you so much for this input into this problem. I have to say this makes me sad This is causing such a disruption to our development. I've already split my scenes into subscenes (Static, Dynamic, Audio, Lighting etc.) but still I get freezes. It looks like its from the Static scene as we have many foliage assets. From my experience it seems tied to the number of GameObjects you have in the scene. Is there any other workarounds you are aware of other than building the project?
Unfortunately I don't. My ultimate conclusion was, after doing all those tests how one can achieve huge worlds, to use an engine that would better fit those requirements.
I seemed to have solved this by using SceneLoad.LoadScene (rather than async) when running in Editor: Code (CSharp): #if UNITY_EDITOR SceneManager.LoadScene(subScenes[i].GetSubSceneName(), LoadSceneMode.Additive); #else AsyncOperation aSync = SceneManager.LoadSceneAsync(subScenes[i].GetSubSceneName(), LoadSceneMode.Additive); subSceneLoadOps.Add(aSync); #endif