AnimancerComponent is the main entry point for controlling animations with Animancer. It also has several sub-classes with additional functionality.
|Type / Examples / Description||Inspector|
Has an Animator Controller and most of the same functions that are normally found on an
|Fading or Layers or Animancer Events or any of the other features of Animancer. It is not even really part of Animancer, it is just a self-contained script designed to play that one animation and nothing else. If you want to do anything more than that you are likely better off using a proper
When using the
Add Component menu in the Unity Editor, all Animancer components are located in the
These components are located in the
Assets/Plugins/Animancer folder and they are even included in Animancer Lite, so you can modify or Inherit from them to implement your own variations. For example:
- Inherit from
AnimancerComponentand add a
SkinnedMeshRendererfield so you can reference it alongside the animations.
- Make a
CharacterAnimationSetclass which inherits from
ScriptableObjectto define a set of animations for each character and then make a
CharacterAnimancerclass which inherits from
AnimancerComponentto allow a character to reference one of those animation sets in the same place as the rest of the animation functionality.
- Inherit from
NamedAnimancerComponentand add an array of
strings so that you can specify a custom name for each animation rather than always using the exact
- Inherit from
AnimancerComponentand add some
AnimationEventReceivers to listen for certain Animation Events.
You can easily change which type of
AnimancerComponent you are using by simply adding a component of the new type to the same object (using the Unity Editor, not using a script).
- Any custom class you make that Inherits from
AnimancerComponentwill also inherit this feature.
- This uses a serialization trick to have the Unity Editor change the old component's type and immediately destroy the newly added component which allows it to retain the values of all its fields that are shared by both types (such as the
Animatorreference) and any references to that component from elsewhere will also be retained (if possible based on the types involved).
- This feature is implemented by calling
AnimancerComponent.Reset, so you can use it in your own scripts by calling that method.
AnimancerComponent.Animator property allows you to access the
Animator component directly if you need to, however many of its members do not work with Animancer (in most cases they are simply not relevant).
The following members work normally:
- Root Motion:
- Bone Transforms:
- Inverse Kinematics:
- Works, but serves no purpose since Animancer doesn't rely on hash codes.
The following members do not work directly:
|Animator Members||Details / Alternative|
||Animancer does not use parameters. Though if you are playing an Animator Controller using a Controller State you can access its parameters via its
||Does not work properly anyway, but Mixers can usually achieve linear blending by disabling Synchronisation on any non-locomotion states (such as Idle or Attack) when blending them with locomotion states (such as Walk or Run).|
||Technically works, but the output from the controller gets overridden by Animancer. Use a
||No direct equivalent. Using a curve to control Inverse Kinematics may help.|
It is unknown whether or not the following members work: (please email firstname.lastname@example.org if you can confirm what these members are actually supposed to do so they can be tested):
- Animation Recording:
- Probably works, but not tested.