- Home /
Lag with dynamic loading
My game is 2.5D, almost 90% contents are textures, similar to Ori. I ensure the assetbundle files size less than 1MB without compression, put in Asset/StreamingAssets folder. When the assetbundle has been loading, the CPU spent less than 1ms and looks well on PC, but there was a lag(or called a momentary pause) on Xbox One. I guess it also happens on Android and iOS.I will try that later. That lag happened when AssetBundle.LoadFromFileAsync to be called. And also happened even if I commented all codes after AssetBundle.LoadFromFileAsync. I have tried many ways: Scale the AssetBundle file to larger or smaller. Package one or more prefab of sprite in AssetBundle. And Instance prefab in several frames. Can someone help me, or any advice?
I also want to know the answer to this question. I hope that the Unity official can pay attention to this issue. Lag with dynamic loading is now the biggest pain point in the 3D game.
Answer by chenjd1989 · Jun 19, 2018 at 06:45 AM
Are you using that to load the AssetBundle from StreamingAssets? AssetBundle.LoadFromFile/LoadFromFileAsync don't cache the ABs, which is bad. On Android it's particularly disastrous because StreamingAssets is compressed to a .jar file, and every read from it (i.e. when loading the AB itself and when loading any assets from it) has to inflate the .jar file. Changing to UnityWebRequest (in Unity 2017) or WWW.LoadFromCacheOrDownload (in Unity 5.x) massively speeds things up on Android, and helps on iOS as well
Your answer
Follow this Question
Related Questions
AssetBundleRequest is done but asset is null 2 Answers
AssetBundle.LoadAssetAsync case freezing in Unity5.5.0p1 5 Answers
Assetbundle fail to load at IOS local 1 Answer
AssetBundleManager.LoadAssetAsync() doesn't work on some android devices (or is very slow) 2 Answers
Assetbundle LoadAsyc speed is much slower than Load 0 Answers