I'm new to Unity3D. I am trying to make my own FPS game in Unity 2020.3. I have to make a lot of maps (scenes). So far I discovered a problem with LoadSceneAsync.
What I know from Unity docs: When AsyncOperation.progress variable is between 0 and 0.9, the engine is loading resources and stuff for the new scene. When it reaches 0.9, it starts activating the new scene (deleting old objects and adding new ones + running Awake and Start methods?).
The problem is that the activation phase takes A LOT of time. For example: when the loading phase takes only a few frames, the activation phase takes about 10 or a 100 times more frames to do its thing.
I tried running the game on another devices and I saw no comparable change in loading speed. Is this a Unity problem or am I using it wrong? Or are those device that I tested the game on just not good enough?
I have no idea why this is happening. I pulled up profiler but I can't understand what exactly is going on. Can somebody please explain what makes this so slow and how to improve its performance?
What version of Unity are you using? When I look at your profiler log I see
Prefabs.MergePrefabs (834,62ms)
:When I google that I find an answer here that seems to imply that this has something to do with nested prefabs, or prefabs used in a GameObject hierarchy.
I honestly am not sure what the answer is saying to do to resolve the issue, but search results also turned up this Unity issue that says a slow
Prefabs.MergePrefabs
is:The issue tracker states that the issue is: