docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Apply animation to a character

    After you’ve generated an animation, you need to apply it to a character in your scene. This involves the following workflow:

    • Create an Animator Controller
    • Add the animation clip to it
    • Assign the controller to the character’s Animator component

    The Animator Controller manages how and when animations play. It lets you control the character movements during gameplay.

    Prerequisites

    Before assigning the animation to a character, ensure the following:

    • Locate the character prefab in Unity's Project window. For example, Assets/Characters/Prefabs.
    • Drag the character prefab into the Scene view.

    Now that your character is added to the scene, you can assign the .anim file to it.

    Set up your character to play the animation

    To set up your character to play the animation, follow these steps:

    1. In your Project window, right-click and select Create > Animation > Animator Controller.

      The controller is saved in the Assets folder. Rename the controller, for example, CharacterAnimator.

    2. Double-click the new Animator Controller to open it in the Animator window.

    3. Drag the .anim file (animation clip) from the Assets window into the Animator window.

      This creates a state that contains your animation.

    4. (Optional) To set the animation as the default state, right-click the state and select Set as Layer Default State.

      You can set up transitions in the Animator if you plan on having multiple animations.

    5. Select your character prefab in the Scene or Hierarch window.

    6. In the Inspector window > Animator component:

      • Drag your Animator Controller (the one you just created) into the Controller field.
      • Ensure the Avatar field displays the name of your character prefab.
    7. To test the animation, open the Game window and select Play in the Unity Editor.

      Your character now performs the assigned animation.

    Manage multiple animations

    You can add multiple animation clips to an Animator Controller and link them together with transitions. For example, a character might start with a walk and then transition into a run animation.

    1. Drag additional .anim files into the Animator Controller.
    2. Create transitions between animations.
    3. Select Play in the Unity Editor to test the sequence.

    Additional resources

    • Troubleshoot issues with Animation Generator
    • Unity animation clips
    • Prompt guidelines for asset generation
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)