🔸Animation Modifiers

In this page you will find general information about modifiers.

Overview

An Animation Modifier defines procedural animation settings and logic. Modifiers reside in the Procedural Animation Settingsarrow-up-right and are placed in a list. You can add multiple modifiers of the same type to the settings:

Animation Modifiers.

Each modifier has a Gizmo-toggle button—use it to enable or disable the UI. This is useful for making adjustments and debugging.

circle-check

All modifiers consist of 2 parts:

  1. Settings: a ScriptableObject that contains data (e.g., bone references).

  2. Animation Job: a runtime-only struct that executes the logic (e.g., applies inverse kinematics).

IK modifiers example.

Weight Overrides

This feature provides more granular control over how modifiers are applied at runtime, using custom float properties:

Weight Override.
  • Weight — a float property to control the influence of this modifier.

  • Is Mask — if enabled, the final value is computed as 1f - Weight.

  • In Range Min and Max — used to remap the Weight value. For example, if the Weight value is in a range other than [0, 1], specify the min and max values of the Weight range.

circle-check

Animation Modifier Settings

AnimationModifierSettings is a base class for all modifier settings in the system:

chevron-rightInheritance and Interfaceshashtag
chevron-rightFieldshashtag
  • characterPrefab: A reference to the player prefab.

  • alpha: A value that controls the influence of this modifier.

  • weightOverrides: Additional float parameters to adjust alpha at runtime. This section is useful when multiple values should affect the influence of a modifier (e.g., blending it out when playing a specific animation).

chevron-rightMethodshashtag
  • InitializeOnLoad(): Called when the game starts. This callback is used to build Property Bindings.

  • CreateAnimationJob(): Called when Procedural Animation Settings are initialized and returns an instance of an Animation Job that executes the logic.

  • GetContext(): Returns a context GameObject for Property Bindings.

  • GetHierarchy(): Returns an array of all bones in the skeleton.

Although the Modifier Settings class is derived from a ScriptableObject, it is not typically instantiated as an asset in the project.

By default, all modifiers exist only in the Procedural Animation Settings and shouldn't be accessed from the outside.

circle-info

Note: Animation Jobs run their logic on the animation thread, so modifying their data at runtime may result in unexpected behaviors.

Animation Modifier Job

An Animation Modifier Job is a struct that executes animation logic. All jobs in the Character Animation System implement 2 interfaces:

  1. IAnimationJob: an interface provided by Unity's Playables API.

  2. IAnimationModifierJob: an interface provided by the Character Animation System.

chevron-rightIAnimationModifierJobhashtag

Animation Modifier Pooling

CAS reuses already allocated modifiers when updating animation settings. When this occurs, the system calls Initialize() and recreates the AnimationScriptPlayable linked to this Animation Modifier.

Last updated