Search Unity

  1. Click here to receive a gift with your purchase of Unity Pro or Unity Enterprise.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Scene loading best practicies?

Discussion in 'Addressables' started by Kolyasisan, Jun 28, 2020.

  1. Kolyasisan


    Feb 2, 2015
    Recently profiling our project we've noticed a certain behaviour with how addressables load scenes. Specifically, how Unity loads and activates the scenes, which is usually load all of the scenes that are already scheduled via Addressables.LoadSceneAsync() and only then activate them one by one. There's not a single time when the profiler showed both the main thread busy with scene activation and the PreloadManager to be busy with loading.

    I wanted to ask if this is a normal behaviour. If not, then how can we mitigate it?
    Adrien_Danglard likes this.
  2. TreyK-47


    Unity Technologies

    Oct 22, 2019
    I'll forward this over to the team for them to take a look, and share any guidance they kick my way.
  3. unity_bill


    Unity Technologies

    Apr 11, 2017

    Unfortunately, that is the nature of how the engine loads scenes, and has for a very long time. In addition to the threading limitations you mention, it's worth also noting that if you use allowSceneActivation=false, you cannot pre-load multiple scenes. As noted in the engine docs here, if scene activation is off, the first scene to get to the ready-state will block the async operation queue.

    We have explored changing that engine behavior, but it's a bit outside the scope of our team, and difficult to do given that a lot of existing games & devs rely on that current behavior.

    Kolyasisan likes this.