Unity Character Animation with Mecanim
eBook - ePub

Unity Character Animation with Mecanim

  1. 290 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Unity Character Animation with Mecanim

About this book

A detailed guide to the complex new animation tools in Unity, packed with clear instructions and illustrated with original content in the context of a next generation zombie apocalypse adventure game

About This Book

  • Create and export models and animation sequences to Unity from 3ds max and Maya
  • Prepare character models and animation for games using Mecanim's rigging tools
  • Retarget, adjust, and mix and match motion capture and other animation data
  • Write and edit scripts compatible with Mecanim Animation Controllers

Who This Book Is For

If you are a Unity developer looking to get to grips with the character animation specific tools, a 3D software user who is new to Unity, or a beginner game developer who is interested in character animation and interaction, this book is ideal for you. Some experience with either the Unity interface or basic 3D coordinates is recommended, but not required.

What You Will Learn

  • Learn how to prepare a rigged character model to receive animation within Unity
  • Acquire efficient techniques to refine and optimize motion capture data
  • Retarget animation sequences between different character rigs
  • Discover how to rig a humanoid character and export for use in Unity
  • Script character interaction for a First Person character model
  • Create dynamic animation sequences from scratch using keyframe techniques, in a variety of 3D software packages
  • Learn Project Management in Unity
  • Understand how to set up a complex facial rig for speech
  • Set up Animation Controllers with masked states and blend trees to create seamless and additive animation transitions
  • Construct a ragdoll game object and instantiate it in a game
  • Devise Mecanim animation integration for the player and AI driven animation for enemy characters

In Detail

Game animation for independent developers has taken a giant leap forward with Unity 5's Mecanim toolset, which streamlines the import/export, retargeting, and many other aspects of the character animation workflow. Unity Character Animation with Mecanim is a great primer for getting to know the nuts and bolts of Mecanim and other character animation related tools in Unity 5. It offers you step-by-step instructions for preparing and exporting rigged models and animation sequences from commonly used 3D packages, such as Maya, 3ds Max and Blender.

This book explores the new set of animation tools introduced with Mecanim in Unity 5. Approaching its subject matter through a typical genre–a zombie action game, character animation techniques are explored using real examples of player input and interaction, enemy behavior, and other aspects of game dynamics. As the book progresses, the reader will understand how these elements fit together in a small game development workflow.

We will begin with a demonstration of the process of getting a rigged character into Unity 5 and setting it up to use provided animation sequences. We will also consider a few industry standard 3D packages and how these can be used to rig a humanoid character for use in Unity 5. We will demonstrate the retargeting capabilities of Mecanim's Humanoid Animation type by adjusting motion sequences to fit disparate character types in our game. After this, we will look at Ragdoll physics and the implementation of this commonly used technique in a Mecanim workflow. The book culminates with a thorough dissection of the enemy character AI script incorporating the Mecanim elements detailed in the previous chapters.

Unity Character Animation with Mecanim will provide you with a detailed exploration of the interaction between game development and character animation, and will broaden your understanding of the rich animation toolset within Unity 5.

Style and approach

A comprehensive guide, featuring step- by- step practical tutorials using sample assets, showing you how to build fully controllable characters and non-player characters/enemies.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Unity Character Animation with Mecanim by Jamie Dean in PDF and/or ePUB format, as well as other popular books in Computer Science & Computer Science General. We have over one million books available in our catalogue for you to explore.

Unity Character Animation with Mecanim


Table of Contents

Unity Character Animation with Mecanim
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
The context
What this book covers
What the book does not cover
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. The Zombie Attacks!
Setting up the project
Importing our enemy
Organizing the material and textures
Adjusting the import scale
Adjusting the rig import settings and creating the Avatar
Choosing the appropriate rig import settings
Creating the Avatar
Adjusting the character's pose
Checking the bone hierarchy in the Avatar
Setting up the animator controller
Creating states
Creating a parameter
Adding transitions
Writing the script
Adjusting the scene elements to preview the animation
Previewing the hit animation in the game view
Summary
2. Rigging Characters for Unity in 3ds Max and Maya
Understanding the need for rigging
Minimum requirements
Sourcing models
Modeling for animation
Rigging in 3ds Max
Setting up the scene
Importing the character model
Creating the Biped system
Adjusting the Biped's parameters
Adjusting the Biped to fit the character
Switching to X-ray mode and freezing the character mesh
Changing bone display colors
Scaling and orienting the bones to match the character model
Repositioning the joints for the ponytail and jaw
Adjusting limb positions
Renaming bones
Copying and pasting the position, rotation, and scale data from one side to the other
Skinning the character using the skin modifier
Creating a selection set
Saving the default pose
Creating the test pose
Making adjustments to the Skin modifier
Adjusting envelopes
Adjusting influence on the head vertices
Painting skin weights for the jaw bone
Exporting the rigged character
Rigging in Maya
Setting up Maya to rig our character model
Setting system units to meters
Changing the display grid size
Importing the model
Adjusting the model scale
Adjusting the viewport display and toolset for joint creation
Creating joints for the back, neck, and head
Renaming and repositioning the joints
Creating the leg joints
Creating the arm joints
Cloning the finger joints
Mirroring joints for the leg and arm chains
Connecting the arm and leg chains
Creating the ponytail and jaw joints
Aligning joint transforms
Creating a test pose
Binding the character mesh to the skeleton
Painting skin weights
Exporting for unity
Summary
3. Interacting with the Environment
Importing the project assets package
Setting up the player character
Creating a new scene
Adding the player character model to the scene
Adding the character controller
Adjusting the camera height
Adding the shoot idle animation
Adding and parenting the gun
Saving the first-person rig as a prefab
Adding the office-level scene
Completing the camera setup
Modifying the animator controller
Setting the transition
Creating a trigger parameter for the Shoot state
Writing and implementing the character animation script
Adding the initial code to the FPSAnimation script
Adding the script to the player character game object
Adding and implementing collectable objects
Instantiating the lunchBox collectable in the game level
Inspecting the lunchBox collectable's components
Looking at the collectable script
Implementing self destruction in the collectable script
Setting up the player character's response
Adding the Pickup state to the animator controller
Setting the Pickup state's transitions and parameter
Transitioning between the ShootIdle and Pickup states
Creating and adding the parameter
Creating the pickup camera
Finalizing the pickup camera prefab
Looking at the player status script
Adding the PlayerStatus script to the player character game object
Updating the Collectable script
Hooking up variables in the collectable script
Updating the FPSAnimation script
Modifying the pickup script
Testing the lunchBox collectable
Summary
4. Working with Motion Capture Data
Introduction to motion capture sequences and their characteristics
Using a motion capture sequence with a pre-rigged model
Getting started
Importing the motion capture sequence
Adjusting the import settings
Adjusting the rig import settings
Adjusting the sequence in the Animations tab
Creating the second walk cycle
Adding the new motion clips to the animation controller
Creating a script to see both animation loops in a...

Table of contents

  1. Unity Character Animation with Mecanim