Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

assetReference.LoadAsset<AnimationClip>() fails when loading from an FBX file.

Discussion in 'Addressables' started by JC_Andres, Jan 29, 2019.

  1. JC_Andres

    JC_Andres

    Joined:
    Jan 23, 2019
    Posts:
    2
    Hi, I'm trying to use addressables to load an animation clip that is contained in an FBX file. The LoadAsset call seems to be able to load the FBX as a GameObject without any issues; however, it fails when I attempt to load the AnimationClip contained within the FBX.

    For whatever is worth, the loading works if the AnimationClip is not part of the FBX.

    Is this intended? If not, is there any particular configuration I need to use?
     
  2. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    440
    Try: Addressables.LoadAsset<IList<AnimationClip>>("MyFBXAddress");

    this should give you all the animations in the FBX
     
  3. JC_Andres

    JC_Andres

    Joined:
    Jan 23, 2019
    Posts:
    2
    Hi Bill, sorry it took me a while to get back to this. I tested the solution you proposed but it didn't work.

    On Editor, debugging the code, the result from the
    IAsyncOperation<IList<AnimationClip>>
    is empty even though the operation returns as successful.

    On Editor the Addressable profiler shows that the appropriate animation has been loaded and increases its reference number correctly. It also looks like the timeline is able to link back to the animation (even though I cannot set it manually because the operation doesn't return any results).

    That being said, on Device (more specifically on Android) the timeline is unable to connect to the right animation, and since the operation returns an empty array I cannot hook it directly myself.