Load async stuck during long time

Hello guys,

I have a problem with my loading async.
I don’t know why but before it worked well. Now he take 45 seconds approximatly to load a new scene.

I’m using HDRP render.
I have use a gui text to check the percent progress of the load async.
He stay 10 seconds at 2%, 5 seconds at 3% etc… and at 7% after he go to 90% and load the scene.

I send you 2 screenshots of my profiler. That’s strange, the graphic is linear during all the load async.
If I delete all my 3D objects in the scene and keep only one 3D object the problem is still there.

The code:

    IEnumerator LoadAsyncScene () {
        AsyncLoad = SceneManager.LoadSceneAsync("Ceclon");
        AsyncLoad.allowSceneActivation = false;
        while (!AsyncLoad.isDone) {
            /*Async information*/
            TextAsync.text = (AsyncLoad.progress * 100).ToString("F0") + "%";
            if ((AsyncLoad.progress >= 0.9f) && (_FadeCanvas.alpha == 1)) {
                TextAsync.text = "100%";
                yield return new WaitForSeconds(0.25f);
                AsyncLoad.allowSceneActivation = true;
            }
            yield return null;
        }
    }

Thank you everyone,

Best regards,

Alexandre


Hi there,

When you load a scene Async, loading is happening detached from the Main thread in the Loading threads further down the timeline and spread across the worker threads too. The Main thread keeps going at the targeted frame rate so that’s why that CPU Usage graph, that only shows Main Thread timings, is rather even.

It looks like you might be on 2020.2? if so you can turn on Flow events and then see how the loading work is spread out over the different threads when selecting some samples that are part of the loading work. When selecting Load samples, the selection tool tip should (from 2020.2 on wards) also show you the name of the assets that are being processed within that sample.