Handle animation
Last updated
Last updated
To add a custom animator controller first create one.
Next, design the animation node based graph as you want.
There are three possible approaches:
You can assign one big runtime controller to the Animator component directly and ignore individual controllers (states).
You can use individual runtime controllers from each state. For more information please read this.
You can use a mix between 1 and 2.
Any state can access the Animator component by using the "Animator" public property from CharacterActor.
Once you got this reference you can do whatever you want. Here is a code snippet taken from the NormalMovement state (Demo):
It is recommended to set certain parameters during the PreCharacterSimulation
and/or PostCharacterSimulation
methods.
The reason for this is because the actor might modify the body velocity along the way, so the values won't be updated by the time the frame is rendered.