Animation States

In most games, the main character usually has some type of action or movement affecting it at all times. Simply, this is to help keep the character and the world realistic. Even if the character is not being interacted with, they will usually have an animation that plays to keep them “alive.” We are doing this with our character with the Player_Idle animation.

But even with an animation made to cover every scenario (walk, run, jump, idle), being able to transition into and out of these requires a bit more detail. Unity helps with this by adding the Animation State Machine.

Note

State machines are a collection of discrete states, inputs, and connection paths. Based on the input received, the active state may switch to a different, ...

Get Learning 2D Game Development with Unity®: A Hands-On Guide to Game Creation 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.