Animation scripts

Animations are controlled using scripts.

You can add an to an entity and set up its parameters in Game Studio. The class is designed to be used mainly from a script.

The more useful properties include:

Note

Animation clips you reference in scripts must be added to the same entity under the AnimationComponent.

For more information, see .

Xenko includes a pre-built AnimationStart script. You can use this script as a template to write your own animation scripts.

To use the AnimationStart script:

  • In the Asset View (bottom pane by default), click Add asset.

  • Specify a name for the script and click Create script.

Create script

3a. If Game Studio asks if you want to save your script, click Save script.

3b. If Game Studio asks if you want to reload the assemblies, click Reload assemblies.

  • Edit the script as necessary and save it.

You an also override the animation blend tree and do all animation blending in the script. The templates First-person shooter, Third-person platformer and Top-down RPG, which use some advanced techniques, are examples of how to do this. For more information, see custom blend trees.