Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Application.LevelLoad() freezes both the Player and Editor on large scenes

Discussion in 'Editor & General Support' started by m-i-e-c-z, Aug 27, 2015.

  1. m-i-e-c-z

    m-i-e-c-z

    Joined:
    Nov 10, 2010
    Posts:
    27
    I've noticed a really strange issue in Unity 5.1.2.f1. I have a large scene with a lot of instantiated in runtime GameObjects (mostly disabled). The scene works smoothly (I've written a simple custom "occlusion culling" that enables / disables GameObjects depending on visibility checked with raycasts). But when I want to load another scene via Application.LevelLoad() the Player freezes and crashes, and the Editor freezes completely without a crash. The exact same scene with less objects appears to work just fine. The same scene worked OK on 4.6.7.

    I've tried removing all the objects from the scene, before loading a new one, but the result is the same. I've also tried using Application.LevelLoadAsync() and Application.LevelLoadAdditiveAsync(). That doesn't freeze the Editor, but i also doesn't load any scene. No warnings or errors are displayed in the Console.

    The bug number I've uploaded is 722749. Unfortunately I couldn't make it public, because of the attached project I'm working on. I will try to replicate this in an "artificial environment" and attach the project.

    If someone experienced similar issues or have an idea for a workaround, please share.