Lightweight Animator Controller
  • Manual
  • Scripting API
Search Results for

    Show / Hide Table of Contents
    • Quick Start
    • When to Use
    • Demo Scenes
    • Tutorials

    Quick Start

    Basic usage

    1. add a LightweightAnimatorController component to the GameObject you want to play animations onto (just like you would with an Animator component)

    2. add or create .anim files to the list of Animations of the component, each with a unique Name

    3. adjust the ACAnimation:

      1. (optional) adjust the Settings of your animations (loop, speed, etc...)
      2. (optional) add Unity events in the xEvents` section
    4. from your desired script, with a reference to the component, call

        animator.PlayAnim("AnimName");
    

    image info

    Limitations

    • the Lightweight Animator Controller relies on animations being in "Legacy" mode, in the sake of being used without Unity's Animator. If an animation needs to be used with both of them in the same project, you will have to duplicate it, and keep one in "Legacy".
    • the Lightweight Animator doesn't support Blend Trees, Avatar Masks, etc. That being said, your project will probably benefit from using the Lightweight Animator Controller. See usecases.
    • the Lightweight Animator doesn't support changing/adding Animations during run time. All necessary animations must be set up in the Inspector, and Initialize() must be called before being able to call PlayAnimation(). (Initialize() is called on Start by default).

    How to...

    enable "Legacy" on an AnimationClip (to use with the LightweightAnimationController)

    • if you have a LightweightAnimationController attached to a gameObject already, you can directly click "Fix Clip", when referencing it
    • alternatively, you can use the menu option "Enable Legacy", when rightclicking on the inspector's header when inspecting a Clip (or through the 3 dots menu button) image info

    disable "Legacy" on an AnimationClip (to use with the LightweightAnimationController)

    • you can use the menu option "Disable Legacy", when rightclicking on the inspector's header when inspecting a Clip (or through the 3 dots menu button) image info
    In This Article
    Back to top Lightweight Animator Controller version 1.0 by Antoine Cherel