Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Animation assets not getting into bundles?

Discussion in 'Asset Bundles' started by DaveA_VR, Jul 13, 2023.

  1. DaveA_VR

    DaveA_VR

    Joined:
    May 26, 2022
    Posts:
    29
    I've got this animated character, with an AnimationController, and the states therein reference some idle animations. Now, this used to work, but just stopped working, and I don't know why: when I build the asset bundle, those idle animations are missing. This shows up both seeing that it's not working properly at runtime, and the Asset Bundle Browser clearly does not show these assets!
    I have never had to explicitly mark these animations as being part of this bundle, in fact, they are shared with other character asset bundles, so should not be. It SHOULD be included by virtue of it being referenced by the animation controller, right? And that animation controller IS in the bundle. And SOME of the other animations referenced by that controller a in the bundle.
    Anyone have any clue or tips what might be going on here?
     
  2. AndrewSkow

    AndrewSkow

    Unity Technologies

    Joined:
    Nov 17, 2020
    Posts:
    78
    I don't know the specifics that might be happening with Animations.

    But one sentence you wrote sticks out "I have never had to explicitly mark these animations as being part of this bundle, in fact, they are shared with other character asset bundles, so should not be."

    Normally with AssetBundles if something is shared by Assets in different Bundles then you must assign explicitly to a bundle. Otherwise it gets duplicated into each bundle. Some features of Unity, including Animation can be broken if an object that is expected to only exist once is duplicated multiple times.

    I also found these internal notes about Animation and Asset Bundles. Its not describing exactly the same thing as your question, but might be helpful:

    "When putting Animation objects into AssetBundles any duplication of the clips can break Assets like the AnimationOverrideController. The simplest solution is to make sure all the animation Assets are included together in the same AssetBundle.

    But it also should be possible to split Animation assets into different Assetbundles, so long as they are all built at the same time and all the Assets are explicitly assigned to an AssetBundle. This is important because like all other Asset times, any implicit reference from multiple AssetBundle is resolved by embedding the referenced object directly in each bundle, e.g. duplicating them. That can lead to clips being duplicated and hence break the behaviour of the AnimationOverrideController.

    "
     
  3. DaveA_VR

    DaveA_VR

    Joined:
    May 26, 2022
    Posts:
    29
    WOW! Thanks for that! Where can I find these internal notes? This may or may not be the problem, but it feels like it probably is. I don't mind duplication, but can't tolerate omission!
     
    Last edited: Jul 14, 2023