0
votes

I'm using Unity 2019 and I'm trying to understand why I have CPU spike when I load a scene, empty or not.

This is what I have in the profilter when I load a scene with SceneManager.LoadScene(xxx) :

Spike when I load a scene

And the hierarchy :

enter image description here

The scene I load is empty (all gameobjects, canvas, scripts etc.. are disabled). I only have a camera.

On each scene I load I have UpdatePreloading and Application.WaitForAsyncOperationToComplete in the hierarchy, and I dont know why.

I disabled all my coroutines, I dont load the scene with LoadSceneAsync, so I dont know what are these "async operations to complete".

I tried to use the profiler with the editor on Windows or from my Android device but it's the same result.

Do you have any ideas ?

What Loading.UpdatePreloading() means ?

What Application.WaitForAsyncOperationToComplete means ?

On each scene load I have these spikes.

Thanks !

1

1 Answers

0
votes

It appears this happens due to the PREVIOUS scene that loads your blank scene. Is there a lot of UI, or Audio / Textures / RenderTextures there? Try loading a blank scene from a totally blank scene.