Animancer v6.0 is currently available for testing.

06 State Machines

Location: Assets/Plugins/Animancer/Examples/06 State Machines

Namespace: Animancer.Examples.StateMachines

These examples demonstrate how you can organise complex systems using Finite State Machines to compartmentalise their logic, resulting in modular scripts which are easy to reuse, debug, and refactor. They use Animancer's state machine system, however the general concepts will work in practically any system.

Note that these examples each have their own namespace and use some of the same class names.

01 Creatures Use Animancer's Finite State Machine system to divide the various actions a character can perform into separate scripts known as states.
02 Interrupt Management Determine which states can interrupt each other using a simple enum.
03 Brains Implement some states with actual functionality and a "Brain" script to control the creature using keyboard input.
04 More Brains Control each creature differently by using different brains even though they share the same scripts for actually performing actions.
05 Weapons Implement a character that can move around and attack with various different weapons.
06 Platformer Make a character controller for a 2D platformer using the ideas introduced in the above examples.