Reader small image

You're reading from  Unity 5.x Animation Cookbook

Product typeBook
Published inMay 2016
Reading LevelExpert
PublisherPackt
ISBN-139781785883910
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Maciej Szczesnik
Maciej Szczesnik
author image
Maciej Szczesnik

Not interested. Too busy with current game project. Source: Linkedin.
Read more about Maciej Szczesnik

Right arrow

Adding behaviors to Mecanim states


In this last recipe, we will cover behaviors. These are scripts that can be attached to Mecanim states. You can use them to turn standard Animator Controllers into logic graphs such as AI trees, quests, and so on.

Getting ready

We are going to create this recipe from scratch and we don't need any special assets. You can download the example project and go to the Chapter 10 Miscellaneous\Recipe 05 Adding behaviors to Mecanim states directory. Open the Example.unity scene there and play the game. If you play the game, you can press the space bar to change the states in the Animator Controller attached to the Controller game object. The cycle starts in the NoBehaviors state—this is simply an empty state with no additional behavior. If we press the space bar, we transition to Light1Random. This state changes the color of the Light1 light in the scene. If we press the space bar again, the state will change to WaitAndSwitch. This state waits for a given time and...

lock icon
The rest of the page is locked
Previous PageNext Chapter
You have been reading a chapter from
Unity 5.x Animation Cookbook
Published in: May 2016Publisher: PacktISBN-13: 9781785883910

Author (1)

author image
Maciej Szczesnik

Not interested. Too busy with current game project. Source: Linkedin.
Read more about Maciej Szczesnik