State Machines

A state machine says what an object is doing right now and what it is allowed to do next. Player movement, enemy AI, menus, and the Animator all get simpler when those states are explicit, instead of buried in a pile of bools and if checks inside Update that all happen to be true at the same time.

More in Architecture

  1. Singletons & Managers
  2. Observer & Events
  3. State Machines
  4. Composition & Dependency Injection

All 42 topics in the Learn Unity Roadmap