A short recap of the animation system

Once again, feel free to explore the official documentation by visiting the following  link:
https://docs.unity3d.com/Manual/AnimationSection.html. Alternatively, follow the official video tutorial here: https://unity3d.com/learn/tutorials/s/animation

When it comes to the animation system in Unity, we can talk about State Machines. Each animation is a node, and the character can change animation according to certain variables of the State Machine. The character can stay only on one state per time and can change animation only to another node that it is linked to it by transitions (there are a few exceptions to this rule when you use nested animation machines, but we won't see them in this book). A transition is represented as an arrow that goes from one node into another. It contains different properties on how to perform the transitions, but more importantly, when to execute the transitions and change state in the animation machine.

In order to explain the process, let's take, for instance, the example in Chapter 5, Freeze! Creating an Intergalactic Shooter (which is similar to the state machine built in the book Getting Started with Unity 5.x 2D Game Developmenthttps://www.packtpub.com/game-development/getting-started-unity-5x-2d-game-development). Despite the title, it's a book worth having a look at. In addition, you can also find an in-depth explanation of the animation system in Chapter 4, No Longer Alone – Sweet-Toothed Pandas Strike:

The Entry node is special because it indicates where the Animation State Machine starts and its transition fires immediately, leading the animation state machine into the Panda_Walk_Animation state. From this state, there are three transitions going outwards, in particular to Panda_Die_Animation, Panda_Hit_Animation, and Panda_Eat_Animation. These transitions are fired based on triggers that are defined on the left in the Parameter panel. Hence, when the script that controls the panda sends a trigger, the animation state machine changes state. This three animation state has only one transition, and it is fired automatically once the animation is finished. In particular, Panda_Die_Animation and Panda_Eat_Animation lead to the Exit state, which is another special state determining the end of the State Machine. On the other hand, the Panda_Hit_Animation state has the transition that goes back to the Panda_Walk_Animation state, in which the animation will loop until another trigger from script arrives.

Now that you should have a better understanding how state and transitions work, it’s time to try on our own by building the animation for our character for this last project, which will be a… Panda!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset