Addressables build is packing Animation Clips (.anim) and Mesh data (.mesh) in BASE project

We have assets which contain rigged and animated models which we are are packaging up into addressable as per Google Play Asset Delivery.

However, while the raw content is being packaged into the asset pack that is configured into the Addressable Group, all the unpacked data such as Animation Clips (.anim) contained in the models and individual mesh data (.mesh) are being packages in the base installable package.

This then causes the base delivery to EXCEED the base installable size for the Android package.

WHY is this happening? the addressable asset packs should contain ALL the content related to assets configured to be delivered by the asset pack, but unpacked content is being embedded in the base.

From what little I can find and read, the issue seems to be with packed models that contain Animations and sub mesh parts, which for whatever reason, Unity unpacks at build time and hosts in the game project.

Even though (and I double checked), in the Inspector view:

  • The PRefab is marked as addressable
  • The model is marked as addressable
  • Confirmed in the “Animations” tab of the model, the animations are addressable
  • The materials are addressable.

However on build and final examination of the Unity asset files, the animations are EXCLUDED from the asset pack, and sub meshes are ADDED to the base asset pack.

OK, after further examination, it turns out the Animations and Meshes are actually in the Addressable Bundle. HOWEVER, they are also duplicated in the base build #facepalm

Has anyone got any ideas for how to exclude these?

In the Build Report, are there no hints as to where or which scenes these assets are being referenced by?

Pretty much if anything in your non Addressable Scene or Assets references any of these Addressable elements, they will be added to the base game.

Are all of your Scenes and prefabs/data objects that could potentially reference them Addressables?

1 Like

Even in a test project which contains a blank scene, the model added to an addressable and nothing else. The Animations and SubMesh’s are still duplicated in the base build.

I re-tested by adding the model into a single scene and it did not make any effect.

The only solution I have now is to Build the addressable first and then DELETE the content prior to making a build, ensuring there is nothing left in there.

I am unable to reproduce your issue in 6000.0.5f1, Addressables Package 2.2.2.

In a clean project, with only a single, blank scene, a model with animations marked as Addressable is not included in the base build.

In the same project, adding the Addressable model to the scene, the model is included in the base build.

In the same project, having a blank scene, and a different scene marked as Addressable that contains the
Addressable model, the model is not included in the base build.

Does your bootstrapper scene per chance reference the model in any way? Remember that there must always be a single scene included in your build, and any asset referenced in that scene will be included in the base build.

As per the test, the animations are included INSIDE the model itself, not separate, just to be clear. And the model also has sub meshes (which are also affected).

In a brand new project (tested in 2022 LTS and latest U6):

  • With the model simply in the project and NO references (or any scripts/scenes) but configured in an addressable. Asset bundle is created with asset, and Animations/submeshes exist in the base build
  • Using the same but with a scene and script referencing the model. Result is the same.
  • Made a prefab of the model, referenced in the scene and in script. WIth only the prefab referenced in the Addressable group. same result.

Every way I cut it, Unity seems to UNPACK the model file contents, cleans up but leaves only the animations and submeshes in the base build to be included.

If the animations are separate to the model, there is no issue.

Confirmed all the above by unzipping the resulting APK/aab, then inspecting the unity3d.asset in the base folder.

However, if you build the addressable packages, then DELETE the folder containing the content PRIOR to doing a build, the issue does not occur.

There must be some sort of obscure bug going on then. I’d suggest opening a ticket with your test scene so Unity can take a look.

Already logged, but as I can replicate the issue with almost any model with embedded animations/meshes in several versions of Unity. Seems this has been an issue for a while.
We shall see what they can pick up.

For now, I have a path through automation at least.