Search Unity

Problem Loading Sprites and Animator Components in prefabs

Discussion in 'Addressables' started by FabioFZynga, Jun 5, 2019.

  1. FabioFZynga

    FabioFZynga

    Joined:
    Sep 24, 2018
    Posts:
    8
    Hi,
    I'm running unity 2019.1.0f2 and addressables 0.8.6 preview.

    I have a LoadingScreen prefab in my Default Local Group which stores a GameObject with an Animator with a few states each with its own anim clip.

    I also have 2 sprites assets (1 jpg and 1 png) under my DefaultLocalGroup.

    When I set the PlayModeScript of the Addressables to "Fast" everything works fine.. as soon as I change to "Virtual Mode" or "Packed Mode" the sprites png fail to load with the following errror:

    Exception: Provider of type UnityEngine.ResourceManagement.ResourceProviders.Simulation.VirtualBundledAssetProvider with id UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider has provided a result of type System.Object which cannot be converted to requested type UnityEngine.Sprite. The operation will be marked as failed.

    while the LoadingScreen.prefab loads without error but its animator component looses the reference to its AnimatorController and therefore fails to play.

    I've tried cleaning and rebuilding the asset caches, wiping StreamingAssets, Library, Obj and Tmp folders..
    I've tried rebuilding the assets database from scratch
    I've tried switching platform and again wiping and rebuilding everything
    All without success.

    The issue started appearing a while ago in the previous 0.7 package version as far as I can tell.

    I'm strongly suspecting it is an Addressables internal problem at this point.
    Is this a known issue? Or do you think there's something else I might be doing wrong?

    Thank you.
     
  2. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    464
    +1, Sprite loading failed in Virtual mode, but works in Fast, Packed Play Mode and binary build.

    Exception encountered in operation Resource<Sprite>(pill.png): Provider of type UnityEngine.ResourceManagement.ResourceProviders.Simulation.VirtualBundledAssetProvider with id UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider has provided a result of type System.Object which cannot be converted to requested type UnityEngine.Sprite. The operation will be marked as failed.
    UnityEngine.ResourceManagement.ResourceProviders.Simulation.InternalOp:RequestOperation_Completed(VBAsyncOperation`1)
    DelegateList`1:Invoke(VBAsyncOperation`1) (at Library/PackageCache/com.unity.addressables@0.8.6-preview/Runtime/ResourceManager/Util/DelegateList.cs:69)
    UnityEngine.ResourceManagement.ResourceManager:Update(Single)
    MonoBehaviourCallbackHooks:Update() (at Library/PackageCache/com.unity.addressables@0.8.6-preview/Runtime/ResourceManager/Util/MonoBehaviourCallbackHooks.cs:19)​
     
  3. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    for sprites in virtual mode:
    - this will be fixed in the next release

    for arrays of sprites and animation clips... doing LoadAssetAsync<IList<Sprite>>();
    - turns out there's an engine bug that makes this generally not work. in the next release we're adding syntax to access sub objects directly. So you could have an FBX with the address "dancer". doing LoadAssetAsync<AnimationClip>("dancer.tapdance"); would load the animation clip named "tapdance" from within the fbx. we are working on getting an engine fix in
     
    Sylmerria likes this.