Model Animations
Learn about the mechanics of model animation playback
Model Animation Trigger Mechanism
There are two main ways to trigger model animations:
- Directly invoking model animations using Kether scripts.
- Using the interaction feedback mechanism between pet behaviors and model animations.
Triggering Animations with Kether Scripts
When playing model animations through Kether scripts, the animation is played forcefully.
Example of use:
When using Kether scripts to play model animations, you must ensure that the corresponding model animation is defined in the pet's configuration.
Kether scripts cannot play animations that are not defined in the configuration.
For example:
In the configuration above, a valid Kether call would be:
However, the following call would be invalid because the model.state
does not include an abab
action:
Interaction Feedback
Model animations can also be triggered automatically through the pet's behaviors. This approach relies on the interaction between behavior actions and model states as configured.
From the configuration above, you can see that the pet's behavior actions (pet.action
) include: attack
, walk
, and lookowner
.
Meanwhile, the model states (model.state
) define animations for attack
and lookowner
.
Based on this configuration, when the pet performs different actions, the following effects occur:
- When performing the
attack
action: The model plays theattack
animation, as it is defined inmodel.state
. - When performing the
walk
action: No model animation is played becausewalk
is not defined inmodel.state
. - When performing the
lookowner
action: The model plays thelookowner
animation, as defined in the configuration.
This interaction mechanism allows pets to automatically display corresponding animations when performing specific behaviors, enhancing interactivity and visual appeal.