- Home /
How to reduce scene load time on mobile?
All my scenes load fine except the scene in which the game is on. I've done a ton of research. Everyone says reduce your assets as much as possible. I only have one instance of every asset. All my assets exist once in either the hierarchy or prefab. I have no public gameobjects. I am object pooling all my sprites. I have all my textures reduced so scale is 1, 1, 1. My file size of app is 14 MB. All my shaders are optimized for mobile. I'm not using mip maps. My texture are on 2 sprite atlases. On a Galaxy Note 4 loading time is about 7 sec. On a Galaxy S3 loading time is about 15 secs. I set it to load game scene first in build setting to see if one scene would have helped, but then unity screen stayed up for about 8 sec on Note 4. I have attached a screenshot of profiler. The problem comes from Loading.AwakeFromLoad. I cant find any documentation about this method. Any ideas on how I can fix this issue?
I'm not sure but Loading.AwakeFromLoad sounds like it might be when Unity calls Awake() on all of the active scene objects' scripts. Check the Awake method in each of your scripts to see if there may be something particularly slow.
One question mentions seeing CPU spikes and slowdown when audio so it may be worth disabling all audio to see if that's the cause.
Otherwise use standard debugging technique: isolate the problem. Try disabling/removing each major section of your scene and loading again... that should help you narrow down where you should be looking. If you find one branch is responsible, repeat again for sub-branches until you find the GameObject responsible, then disable scripts on the game object one by one.
I'm not using any Awake methods. I can't use AssetBundles because wont be connected to internet. Im thinking of loading some assets in earlier scenes, and maybe use don't destroy. Is there a way to see what assets are taking the longest? Is there something more efficient than don't destroy?
I already described what I would do if the profiler doesn't give you any joy: iteratively disable parts of your scene until you find the culprit.
Answer by ItzMrJohn2You · Apr 04, 2015 at 03:26 AM
Yea, I figured it out. I had my audio files decompressing on load. Thanks for the help.
how did you track it down , as i have a similar issue
It'd be more helpful if you talked about how you tackled the problem and what led you to finding that it's a problem with the audio.
This post may help you to understand audio clip import settings: http://blog.theknightsofunity.com/wrong-import-settings-killing-unity-game-part-2/
If I use your settings there is a 1 sec lag on certain sound effects on my Android Games. But if I set everything to decompressing on load the start time goes to 7 seconds.
Any advice from the Pros?
Answer by DanishSinha · Oct 12, 2017 at 11:17 PM
Did you find more ways to optimize your game load other than setting audio files? It would really help me in my game. :)