Follow

How can I load Assets asynchronously from AssetBundles stored in disk?

Symptoms 

  • The asset content of AssetBundles is loading from the disk in a synchronous manner. 

Cause

The main thread is blocked while loading the assets. This can make the game have hiccups. 

Resolution

To load the objects of the AssetBundles in an asynchronous way, in order to avoid blocking the main thread of the computer, you need to call the AssetBundle.LoadAssetAsync method.

To learn more about this, please see the sub-section about loading objects from an AssetBundles asynchronously in Unity's Loading AssetBundles documentation page.

More Information
http://docs.unity3d.com/Manual/AssetBundlesIntro.html
This article applies to Unity version 5.3

 

Was this article helpful?
0 out of 1 found this helpful
Have more questions? Submit a request

2 Comments

  • 0
    Avatar
    Ellery Chan

    Documentation comment:

    The "Loading AssetBundles" link is broken.

    Specific issue:

    When I use AssetBundle.LoadAssetAsync, it still freezes up the rendering thread while loading the asset.  Why does this happen?  This is in Unity 2017.1.

    General comment:

    Developers need more information about where the data are going when asset loading operations are being performed.  From reading the docs, it appears that first an AssetBundle is retrieved from storage and eventually ends up in system RAM.

    Next, an asset, such as a GameObject containing meshes and textures, is retrieved from the AssetBundle.  Does this create a copy of the asset in RAM?  (This is where the rendering hitch occurs for me.)

    Next, the GameObject is instantiated.  Does this copy the data to the GPU?  Is there still a copy in RAM?

    This kind of information should be stated explicitly and often throughout the Unity documentation, as it would greatly reduce the amount of confusion and guesswork experienced by developers, and allow them to write more efficient games.

  • 0
    Avatar
    Guillaume Henri

    Hello

Please sign in to leave a comment.