Book Image

Unity 5.x Animation Cookbook

By : Maciej Szczesnik
Book Image

Unity 5.x Animation Cookbook

By: Maciej Szczesnik

Overview of this book

This recipe-based practical guide will show you how to unleash the power of animation in Unity 5.x and make your games visually impeccable. Our primary focus is on showing you tools and techniques to animate not only humanoid biped characters, but also other elements. This includes non-humanoid character animation, game world creation, UI element animation, and other key features such as opening doors, changing lights, transitioning to different scenes, using physics, setting up ragdolls, creating destructible objects and more. While discussing these topics, the book will focus on mecanim, the Unity 3D animation tool, and how you can use it to perform all these tasks efficiently and quickly. It contains a downloadable Unity project with interactive examples for all the recipes. By the end of this book, you will be confident and self-sufficient in animating your Unity 3D games efficiently.
Table of Contents (17 chapters)
Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Using Animation Events to trigger sound and visual effects


This recipe shows a simple, generic way of playing different sound and visual effects with Animation Events.

Getting ready

To start, you need to have a character with one looped animation: Jump. We also need a sound effect and a particle system. We will need a transparent DustParticle.png texture for the particle system. It should resemble a small dust cloud. You can open the provided example Unity project and go to the Chapter 07 Special effects\Recipe 01 Using animation events to trigger sound and visual effects directory. In the Rigs directory, you will find all the needed animations, and in the Resources folder, you will find all other necessary assets. When you play the game, you will see a character playing the Jump animation. It will also play a sound effect and a particle effect when landing.

How to do it...

To play sound and visual effects with Animation Events, follow these steps:

  1. Import the character with the Jump animation...