07 Sprites

Location: Samples/07 Sprites

These samples demonstrate how you can group animations into sets of up/right/down/left (with or without diagonals) using Directional Animation Sets to implement characters who can face any direction while performing various actions.

This concept can be extended to any situation where you want to define a reusable structure for a set of animations (whether 2D like these samples or not). For example, you could make a CharacterAnimationSet containing all the standard animations of a character (Idle, Walk, Run, Attack, etc.) or a Weapon could hold all the animations that characters need to use when it is equipped like in the Wepons sample. That way you can reuse the same structure throughout your project.

These samples focus on using animations in Animancer. For actually creating Sprite based animations, several of the Animancer Tools can help with that and some of the official Unity tutorials explain other ways of doing it:

07-01 Directional Basics Use DirectionalAnimationSets to organise animations in groups of up/right/down/left, using the exact same structure for both Idle and Walk animations across various different characters.
07-02 Directional Character Use DirectionalAnimationSets in a slightly more complex character and then change to a character that uses DirectionalAnimationSet8s to support diagonal movement as well, without changing the controller script at all.
07-03 Directional Character 3D Use directional Sprite animations for 2D characters within a 3D environment.
Platformer Game Kit The Platformer Game Kit is a much more extensive example of how to use Animancer in a complex game.