Skip to content

How To: Animator Meta

David Dionisio edited this page Feb 17, 2017 · 2 revisions

The Animator Meta is great for when you want to use the same animations for multiple objects. Think of it as prefabs, but for animations. This is pretty much using the same system as Unity's animation. You can also reduce the memory overhead when using Animator Meta for lots of objects instantiated.

Things To Consider

  • When using Animator Meta, be aware that the tracks use the name and hierarchy path to determine what object to target. If you change the hierarchy path or name of the object, you will need to do this for all other objects that share the animation.

Example Steps To Create an Animator Meta:

  1. Create a new Animator component to any object in the scene.
  2. Add a child to that object with the animator. Example: a Cube.
  3. Add another child, perhaps under cube. Example: Cube->Capsule.

As an example, I have something like this:

  1. Add a take, or use the default generated take (Take1).
  2. Add some tracks, be sure to make use of the two objects. Example: A translate track for Cube, rotation track for Capsule.
  3. Once you are done adding keys to the tracks, click on the object that holds the animator, and check the inspector.

  1. Click on the "Save As...".
  2. Choose the location and name of the prefab.

Once you save the prefab, the animator on the object will now reference all its takes, tracks, keys on that prefab. You will notice that the "Meta Field" of the animator points to the newly created prefab.

  1. Go back to editing the timeline of that animator.
  2. Edit some of the keys, or add more keys on the tracks. You will notice an indication that the meta data is "dirty".

From here, you can either "Save" or "Revert". Saving will commit the changes you made to the animator, and vice versa for Revert.

Similar to Unity, you can break the meta data to instantiate all its takes, tracks, keys on the object. From here, it becomes a normal animator.

When you want to use this Animator Meta on another object, simply drag the prefab on the "Meta Field" of the Animator Data. You can edit the Animator Meta's timeline on this object, and saving it will reflect its changes for all other objects that use this meta data.

If you want to debug an issue with the Animator Meta, you can check the track data from the prefab itself. You can see the target paths used by tracks in the inspector:

Clone this wiki locally