Creating state machine behaviors

Now that we're familiar with the concept of a state machine, let's get our hands dirty and start implementing our very own.

As of Unity 2017.1, state machines are still part of the animation system, but worry not, they are flexible and no animations are actually required to implement them. Don't be alarmed or confused if you see code referencing the Animator component or the AnimationController asset as it's merely a quirk of the current implementation. It's possible that Unity will address this in a later version, but the concepts will likely not change.

Let's fire up Unity, create a new project, and get to it.

Get Unity 2017 Game AI Programming - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.