Set up animations

BeginnerDesignerProgrammer import animation assets, you need add them to an entity and play them with a script.

1. Add animation assets to an entity

  • Scene Editor, select the entity you want to animate.
    Note
    To animate an entity, the entity must have a model component.
  • Property Grid, click Add component and choose Animations. Game Studio adds an animation component to the entity.
  • Animations, click (Add) to add a new animation to the library.
  • Type a name for the animation and press Enter.
    Tip
    not the name of the animation asset. To make identification easy, we recommend you give your animation the same name as the animation asset.
  • (Select an asset). Select an asset window opens.
  • OK. Game Studio adds the animation asset to the entity. You can add as many animations to the animation component as you need. The Property Grid lists them in alphabetical order.

    2. Create a script to play the animations

    script.

    Example script

    1. public class SimpleAnimationScript : StartupScript { public override void Start() { Entity.Get<AnimationComponent>().Play("Walk"); } }
    Walk under the animation component on the entity. animation scripts.

    3. Add the script to the entity

  • Scene Editor, select the entity you want to animate.
  • Property Grid, click Add component and choose the animation script you want to add. public variables you define in the script in the Property Grid under the script component properties.

    See also

  • Animation index
  • Import animations
  • Animation properties
  • Preview animations
  • Animation scripts
  • Additive animation
  • Procedural animation
  • Custom blend trees
  • Model node links
  • custom attributes