How it works...

This recipe uses the Animator Controller to create states for the character. Our bird can sit on the ground and fly. We also have transition animations between those two looped states to make the bird start flying or land. With this simple setup, we can create birds that will react to the player. They can, for instance, start flying when player is near and land if player walks away. The purpose of this recipe is to show that we can create interesting behavior with just the animations alone (and one script to call the animations). Animated game objects that have no scripts and no rigid bodies attached are quite lightweight in Unity. That allows us to use them as interesting decorations.

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

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