You are previewing Unity 5.x Animation Cookbook.
O'Reilly logo
Unity 5.x Animation Cookbook

Book Description

A recipe-based guide to give you practical information on Unity 5.x animation techniques and tools

About This Book

  • A straightforward and easy-to-follow format.

  • A selection of the most important tasks and problems.

  • Carefully organized instructions to solve problems efficiently.

  • Clear explanations of what you did.

  • Solutions that can be applied to solve real-world problems.

  • Who This Book Is For

    This book is for Unity developers who have some exposure to Unity game development who want to learn the nuances of animation in Unity. Previous knowledge of animation techniques and mecanim is not necessary.

    What You Will Learn

  • Importing animations to Unity

  • Work with different animation assets and components

  • Create, visualize, and edit animated creatures

  • Animating game cut scenes

  • Design character actions and expressions

  • Create gameplay by animating characters and environments

  • Use animations to drive in-game logic

  • In Detail

    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.

    Style and approach

    This practical no-nonsense guide is recipe-based with real-world examples of almost all the techniques mentioned.

    Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

    Table of Contents

    1. Unity 5.x Animation Cookbook
      1. Unity 5.x Animation Cookbook
      2. Credits
      3. About the Author
      4. About the Reviewer
      5. www.PacktPub.com
        1. eBooks, discount offers, and more
          1. Why subscribe?
          2. Free access for Packt account holders
      6. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Sections
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Conventions
        6. Reader feedback
        7. Customer support
          1. Downloading the example code
          2. Downloading the color images of this book 
          3. Errata
          4. Piracy
          5. Questions
      7. 1. Working with Animations
        1. Introduction
        2. Importing skeletal animations
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        3. Configuring generic and humanoid rigs
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        4. Creating and assigning an Animator Controller
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        5. Creating animation transitions in Animator Controller
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        6. Using parameters to control the animation flow
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        7. Using animations from multiple assets
          1. Getting ready
          2. How to do it...
          3. How it works...
        8. Looping, mirroring and offsetting the animations
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        9. Adjusting the playback speed of animations
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        10. Using override animator controllers to animate different types of characters
          1. Getting ready
          2. How to do it...
          3. How it works...
        11. Importing object animation from a 3D package
          1. Getting ready
          2. How to do it...
          3. How it works...
      8. 2. Working with the Animation View
        1. Introduction
        2. Using the Animation View to create a flickering light
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        3. Blending light colors with the Animation View and the Animator Controller
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Animating an object's world position - creating a moving platform
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        5. Animating object's local position - creating automatic doors
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        6. Using the Hierarchy to animate local rotation - creating an orbiting planet
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        7. Animating triggers - creating a death trap
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        8. Creating an elevator triggered by player input
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
      9. 3. 2D and User Interface Animation
        1. Introduction
        2. Exporting a 2D sprite animation from a 3D package
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. Creating a frame-by-frame sprite animation with the Animation View
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Creating a 2D sprite doll animation with the Animation View
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Using the Animator Controller to play sprite animations
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        6. Creating a fade out - fade in transition with the Animation View
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Creating a swipe transition with the Animation View
          1. Getting ready
          2. How to do it...
          3. How it works...
        8. Using filled images for creating animated progress bars
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        9. Using Mecanim states for animating UI button states
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
      10. 4. Character Movement
        1. Introduction
        2. Using Blend Trees to blend walk and run animations
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        3. Using root motion to drive Rigid Body characters' movement with animations
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        4. Using root motion to steer a character
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Using animations for better looking transitions
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        6. Using root motion for a 180 degrees turn
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        7. Making a character jump with 3-phase animation
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        8. Using root motion to drive a NavMesh Agents' movement with animations
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        9. Using triggers to grab an edge while jumping
          1. Getting ready
          2. How to do it...
      11. 5. Character Actions and Expressions
        1. Introduction
        2. Creating an appear or a disappear animation
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        3. Creating background characters and critters with animation-driven behavior
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        4. Using Blend Trees to create randomized actions
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        5. Using Quaternion.LookRotation() and Animator.SetLookAtPosition() methods to make characters follow an object with their gaze
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        6. Action Points - performing an action in a specified spot
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        7. Synchronizing an animation with objects in the scene
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        8. Using IK for interacting with scene objects
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        9. Animating facial expressions with Blend Shapes
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
      12. 6. Handling Combat
        1. Introduction
        2. Using Sub-State Machines in Animator Controller
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        3. Using Animation Events to trigger script functions
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        4. Using transitions from Any State to play hit reactions
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Using root motion to create a dodge move
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        6. Checking what Animator state is currently active to disable or enable player actions
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        7. Using Animation Events to draw a weapon
          1. Getting ready
          2. How to do it...
          3. How it works...
        8. Using Avatar Masks and animator controller layers to walk and aim
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        9. Using the LookAt() method to aim
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        10. Using Blend Trees to aim
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        11. Detecting the hit location on a character
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
      13. 7. Special Effects
        1. Introduction
        2. Using Animation Events to trigger sound and visual effects
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        3. Creating camera shakes with the Animation View and the Animator Controller
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        4. Using the Animation View to animate public script variables
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Using additive Mecanim layers to add extra motion to a character
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Using Blend Shapes to morph an object into another one
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Using wind emitters to create motion for foliage and particle systems
          1. Getting ready
          2. How to do it...
          3. How it works...
        8. Using sprite sheets to animate particles
          1. Getting ready
          2. How to do it...
          3. How it works...
        9. Animating properties of a particle system with the Animation View
          1. Getting ready
          2. How to do it...
          3. How it works...
        10. Using waveform of a sound clip to animate objects in the scene
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        11. Creating a day and night cycle with the Animation View
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
      14. 8. Animating Cutscenes
        1. Introduction
        2. Using the Animation View to animate the camera
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        3. Changing cameras with animation
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Synchronizing animation of multiple objects
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        5. Importing a whole cutscene from a 3D package
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        6. Synchronizing subtitles
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Using root motion to play cutscenes in gameplay
          1. Getting ready
          2. How to do it...
          3. How it works...
      15. 9. Physics and Animations
        1. Introduction
        2. Using cloth
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        3. Using rigid body joints
          1. Getting ready
          2. How to do it...
          3. How it works...
        4. Destructible objects
          1. Getting ready
          2. How to do it...
          3. How it works...
        5. Creating a humanoid ragdoll with the ragdoll wizard
          1. Getting ready
          2. How to do it...
          3. How it works...
        6. Creating a generic ragdoll with character joints
          1. Getting ready
          2. How to do it...
          3. How it works...
        7. Applying force to a ragdoll
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        8. Dismemberment
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        9. Getting up from a ragdoll
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
      16. 10. Miscellaneous
        1. Introduction
        2. Using math to animate an object
          1. Getting ready
          2. How to do it...
          3. How it works...
        3. Using the Lerp() function to animate an object
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        4. Using the Rotate() function to animate an object
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        5. Preparing motion capture files for humanoid characters
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        6. Adding behaviors to Mecanim states
          1. Getting ready
          2. How to do it...
          3. How it works...