Book Image

Mastering Unity 5.x

By : Alan Thorn
Book Image

Mastering Unity 5.x

By: Alan Thorn

Overview of this book

Mastering Unity 5.x is for developers wishing to optimize the features of Unity 5.x. With an in-depth focus on a practical project, learn all about Unity architecture and impressive animation techniques. With this book, produce fun games with confidence.
Table of Contents (16 chapters)
Mastering Unity 5.x
Credits
About the Author
Acknowledgment
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Getting started with the zombie Prefab


The zombie character will appear many times throughout a level, and other levels. For this reason, we'll build one zombie in the Viewport and, from that, create a Prefab. This may be reused as many times as needed. To start, drag and drop the zombie from the Project Panel into the Scene, and set its Scale to 1.3 for all axes:

Adding a zombie character to the Scene and setting object Scale

Next, add a Nav Mesh Agent to the zombie, configuring it for a navigation mesh. Set the Radius to 0.26, fitting the Cylinder collider tightly to the character.

Note

This volume approximates the character on the navigation mesh. If it's too large, the character won't fit through tight but passable spaces; and if too small, the character will pass through impossibly narrow spaces.

Additionally, set the Speed to 0.6, and the Stopping Distance to 3. The Stopping Distance variable specifies how close to its destination an agent should reach before stopping:

Configuring a...