The Mecanim 2D animation bridge simple plays 2D animations when animation state changes.
- Directly Playing animations without transitions.
- Simple animation priority (higher priority animations must play to completion before lower priority animations play)
- Animator Overrides
Warning: The Mecanim 2D animation bridge requires all states supported by your character have matching states in the Mecanim Animator (animation state tree). These names must be an exact upper-case match with the state name.
This quick start assumes you have a character, and have already created animations for your sprite.
- Create an Empty GameObject that is a child of your Character. Name it CharacterSprite or something else meaningful.
- Drag your characters Idle animation to the newly created GameObject.
- Select the prefab Template-Mecanim2D-AnimationController and duplicate it. Rename this duplicate something meaningful.
- Assign this newly created prefab to the Animation Controller property of the Animator component of your newly created sprite GameObject.
- Open the Animation view.
- Drag your characters sprite animations to each matching animation state.
You should now have an animated character.
In order for the Mecanim 2D bridge to animate it requires:
- An Animator component.
- A SpriteRenderer or MeshRenderer or SkinnedMeshRenderer (and associated components).
The Mecanim 2D animation bridge relies on an Animation Controller with animation state names being the same the AnimationState enum. This means the state name should be an exact match with capital letters, for example: WALK or AIRBORNE.