Search Unity

Asset Bundle Scene: Not All Gameobjects Loading

Discussion in 'Editor & General Support' started by viciousesque, Apr 7, 2016.

  1. viciousesque

    viciousesque

    Joined:
    Oct 4, 2014
    Posts:
    34
    I'm creating Asset Bundles for individual scenes using the AssetBundleManager tools. In the editor, in LocalAssetBundle Server mode, everything works fine. Asset Bundles and load, and I'm able to load scenes from those Asset Bundles, and those loaded scenes have all the expected game objects.

    Once I place my build Asset Bundles on a remote server, and build my project to iOS however, some, but not all, game objects are missing from scenes loaded from the remote Asset Bundles.

    Looking at my debug output in Xcode, it looks like I'm successful calling the remote Asset Bundles, and again, they I'm able to load those scenes, but currently only the 2d UI button from those scenes is present in the scene. The other main element, a simple sphere with red material on it, is missing.

    I'm unable to find much online at all about Asset Bundle scenes, and the two unity tutorials don't go into any specifics about how to make sure game elements from scenes are included in the builds.

    Could it be because the sphere from this scene exists only in the hierarchy of the scene, and not in the assets directory? Do I really want to create prefabs for all the elements in a scene i'm going to Bundle up, then pull those prefabs into the scene, then build my Asset Bundles?
     
  2. Deleted User

    Deleted User

    Guest

    For scenes, we will build the scene into a streamed scene asset bundle with all the game objects. So you don't have to create prefab for it.

    If the asset bundles works in the LocalAssetBundle server mode, then the asset bundle itself should be fine. Really have no idea why it misses game objects...

    Would be better create a bug for it with the project, then we can have a look
     
  3. viciousesque

    viciousesque

    Joined:
    Oct 4, 2014
    Posts:
    34
    When loading the remote Asset Bundle Xcode debug outputs a series of messages like this:

    Could not produce class with ID 108.
    This could be caused by a class being stripped from the build even though it is needed. Try disabling 'Strip Engine Code' in Player Settings.

    In the manifest for the Asset Bundle I see empty nodes on a ClassTypes hash for each of the IDs Xcode is complaining about:

    - Class: 104
    Script: {instanceID: 0}
    - Class: 108
    Script: {instanceID: 0}
    ...

    In addition on this ClassType hash in the Asset Bundle manifest, I see what appear to be nodes with positive values:

    - Class: 114
    Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
    - Class: 114
    Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
    ...

    Should the manifest contain a mix of empty class references like that? Could this be related to my problem, since some object appear in the scene and others do not?
     
  4. Deleted User

    Deleted User

    Guest

    I think the problem is the asset bundles contain the types which have been stripped when build player, as the player data doesn't use those types.

    We're fixing this issue, it will be in the future release. But for now, just disable the "Strip Engine code" as the error message tells.
     
    viciousesque likes this.
  5. viciousesque

    viciousesque

    Joined:
    Oct 4, 2014
    Posts:
    34
    Thanks, Vincent. Disabling "Strip Engine Code" in Player Settings fixed the issue. All my scene Asset Bundles are now loading from the remote server to the iOS device fully intact and functional.

    Thanks.
     
  6. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    543