Animation States
Overview
Animation state executes movement and rotation based on decisions made by the HFSM. In other words, the HFSM decides WHAT needs to be done -e.g. move to point X, look at enemy Y- and the animation state decides HOW to achieve the decision taken.
The Animation state is an asset. An AI Agent can have multiple different animation states configured in its AIConfig
but only one active animation state at any given time.
Switching between animation states is done in the AI
component and is currently tied to traversing specific NavMesh link. It is possible to add new or extend existing switching mechanism (see AI.User.cs
for the partial method implementation).
Move Animation State
The default animation state is Move
. As the names implies, it is used for moving an agent on the NavMesh and performs standard rotation behavior. Dash jumping can be turned on for this asset which enables agents to jump instead of walk in certain situations to speed up movement.
Jump Animation State
The Jump
animation state is activated when the NavMesh agent is traversing a Jump link - more on Jump links can be found in the NavMesh Links section. This animation state requires a special movement behavior as the agent needs to:
- run towards the edge of geometry (a certain distance is assumed between the current agent position and the link's start);
- jump; and,
- steer towards the other side.
After the agent lands on ground the Jump
animation state is terminated and transitions to the default (Move
) animation state.
JumpPad Animation State
Similar to the Jump
state but this time the agent needs to:
- reach a pre-defined location -the
JumpPad
-; - wait until the
JumpPad
is activated; and, - try to push towards the
JumpPad
destination.
This allows ab AI to perform long JumpPad
jumps.
Drop Animation State
Simple animation state activated when traversing a Drop link - more on Drop links can be found in the NavMesh Links section
Possible Extension Examples
Here are some examples of possible animation states that are not implemented in the FPS Template:
Fly
: drones and other above ground agents can still use NavMesh pathfinding for reference but their movement behavior would be different - cutting corners, moving up or down based on ceiling space etc.RocketJump
: very specific behavior that needs to be executed to perform a successful rocket jump.WallJump
: a specific type of enemy who would use a custom set of data (e.g. points placed on walls) to calculate its movement rather than the NavMesh.