万本电子书0元读

万本电子书0元读

顶部广告

Unity Character Animation with Mecanim电子书

售       价:¥

6人正在读 | 0人评论 9.8

作       者:Jamie Dean

出  版  社:Packt Publishing

出版时间:2015-09-29

字       数:350.9万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
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 *s 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'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. 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. 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 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. 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 * 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. 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.
目录展开

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 action

Adding the script and previewing the animation switch

Summary

5. Retargeting Animation

Loading the scene

Adding and previewing the animation

Adjusting import settings to get a better fit

Creating a duplicate walk cycle

Adjusting the motion parameters

Adjusting the muscle limits

Working with Avatar Body Masks

Opening the new scene

Creating a second layer in the animator controller

Creating states in the mask layer

Setting the parameter and transitions in the mask layer

Editing the script

Previewing the masked animation

Creating five walk variations from two walk cycles

Adding more Avatar masks

Summary

6. Talking Heads

Adding the snarl face animation to the female zombie character

Setting the scene in Unity

Adding code to the zombie_ready script

Adding the TurnToPlayer function

Connecting the variables in the Inspector panel

Updating the animator controller to include the face animation

Adding the Snarl state

Creating a Null state

Setting transitions between the Null and Snarl states

Creating the IsSnarling parameter

Editing the script to include the Face layer

Smoothing the zombie's turn rotation

Implementing the turn animation

Adding the turning state

Setting up the IsTurning parameter

Creating the transitions to connect the turning state

Setting the transitions for the Turn state

Updating the zombie_ready script to accommodate the Turn state

Creating the Snarl function

Synchronizing the snarl sound

Driving a blendshape animation with the animator controller

Viewing the blendshape in Unity

Keyframing the face blendshape

Updating the animator to handle the blendshape animation

Summary

7. Controlling Player Animation with Blend Trees

Adding a Blend Tree to the player's existing animator controller

Adding strafing animation to the player character with a Blend Tree

Using Blend Tree properties

Adding the motion clips to the Blend Tree

Adding and adjusting the Blend Tree parameters and thresholds

Updating the character script to use the Blend Tree

Testing the Blend Tree in the Game View

Varying the pickup animation with a Blend Tree

Viewing the pickup_heavy animation sequence

Creating a Blend Tree in the Pickup state

Setting the pickup Blend Tree parameter

Setting the threshold for the pickup Blend Tree

Editing the character animation script to accommodate the pickup Blend Tree

Updating the Collectable script to include a weight variable

Sending the objectWeight variable

Updating the Pick function in the character animation script

Testing the blended animation in the game

Instancing the collectable prefabs

Previewing the blended animation

Summary

8. Implementing Ragdoll Physics

Introduction to joints in Unity

Creating a test scene

Adding a hinge joint

Creating the ragdoll object

Assigning the material

Generating the initial ragdoll

Assigning bones to the ragdoll list

Assigning mass

Previewing the default ragdoll

Adjusting collision objects

Adjusting the radius of the capsule collider to fit the leg

Adjusting the head's collider

Fine-tuning the character joints

Adjusting the rotational limits of the upper arm

Adjusting the rotational limits of the forearm

Adjusting the rotational limits of the head

Previewing the adjusted ragdoll

Adding a custom joint to the ragdoll

Adding a capsule collider to the ponytail

Adding a Rigidbody component

Adding the character joint

Saving the ragdoll as a prefab

Summary

9. Controlling Enemy Animation with AI and Triggers

Implementing range detection

Looking at the scene

Adding the initial AI script

Adding proximity detection to the enemy AI script

Setting up the patrol behavior

Adding variables for the patrol

Adding the initial patrol code to the Update function

Defining patrol points

Modifying the animator

Adding and accessing an animation curve

Accessing the animation curve in Mecanim and using it in the script

Adding the attack

Adding the Attack state

Associating tags with the enemy and player game objects

Allowing the zombie to hurt the player

Damaging and killing the zombie

Allowing the player to fire

Pathfinding and obstacle detection with navMesh

Suspending navigation during the turn

Adjusting navigation during the attack

Modifying the Attack function

Timing out the zombie's pursuit

Summary

Index

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部