O'Reilly logo

Unity AI Game Programming - Second Edition by Thet Naing Swe, Clifford Peters, Aung Sithu Kyaw, Ray Barrera

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 5.0.0f4, 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 fathomable 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.

Creating the AnimationController asset

The AnimationController asset is a type of asset within Unity ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required