100% found this document useful (4 votes)
22 views

Game development with Unity 2nd Edition Edition Michelle Menard 2024 scribd download

The document provides information about the book 'Game Development with Unity, 2nd Edition' by Michelle Menard and Bryan Wagstaff, including download links and related ebooks. It outlines the book's content, which covers various aspects of game development using Unity, and acknowledges contributors to the project. The book is published by Cengage Learning and is aimed at helping readers learn and enhance their game development skills.

Uploaded by

ortaqdaboul
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (4 votes)
22 views

Game development with Unity 2nd Edition Edition Michelle Menard 2024 scribd download

The document provides information about the book 'Game Development with Unity, 2nd Edition' by Michelle Menard and Bryan Wagstaff, including download links and related ebooks. It outlines the book's content, which covers various aspects of game development using Unity, and acknowledges contributors to the project. The book is published by Cengage Learning and is aimed at helping readers learn and enhance their game development skills.

Uploaded by

ortaqdaboul
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 67

Visit https://ebookfinal.

com to download the full version and


explore more ebooks

Game development with Unity 2nd Edition Edition


Michelle Menard

_____ Click the link below to download _____


https://ebookfinal.com/download/game-development-with-
unity-2nd-edition-edition-michelle-menard/

Explore and download more ebooks at ebookfinal.com


Here are some suggested products you might be interested in.
Click the link to download

Beginning 3D Game Development with Unity All in One Multi


Platform Game Development 2nd edition Edition Sue Blackman

https://ebookfinal.com/download/beginning-3d-game-development-with-
unity-all-in-one-multi-platform-game-development-2nd-edition-edition-
sue-blackman/

Game Audio Development with Unity 5 X Design a blockbuster


game soundtrack with Unity 5 X 1st Edition Micheal Lanham

https://ebookfinal.com/download/game-audio-development-with-
unity-5-x-design-a-blockbuster-game-soundtrack-with-unity-5-x-1st-
edition-micheal-lanham/

Unity in Action Multiplatform Game Development in C with


Unity 5 1st Edition Joseph Hocking

https://ebookfinal.com/download/unity-in-action-multiplatform-game-
development-in-c-with-unity-5-1st-edition-joseph-hocking/

Getting Started with Unity 2018 A Beginner s Guide to 2D


and 3D Game Development with Unity Third Edition. Edition
Edward Lavieri
https://ebookfinal.com/download/getting-started-with-
unity-2018-a-beginner-s-guide-to-2d-and-3d-game-development-with-
unity-third-edition-edition-edward-lavieri/
Learn Unity for 2D Game Development 1st Edition Alan Thorn

https://ebookfinal.com/download/learn-unity-for-2d-game-
development-1st-edition-alan-thorn/

Procedural Content Generation for Unity Game Development


Harness the power of procedural content generation to
design unique games with Unity 1st Edition Ryan Watkins
https://ebookfinal.com/download/procedural-content-generation-for-
unity-game-development-harness-the-power-of-procedural-content-
generation-to-design-unique-games-with-unity-1st-edition-ryan-watkins/

Learn 2D Game Development with C 1st Edition Jebediah


Pavleas

https://ebookfinal.com/download/learn-2d-game-development-with-c-1st-
edition-jebediah-pavleas/

Creating 3D Game Art for the iPhone with Unity Featuring


modo and Blender Pipelines 1st Edition Wes Mcdermott

https://ebookfinal.com/download/creating-3d-game-art-for-the-iphone-
with-unity-featuring-modo-and-blender-pipelines-1st-edition-wes-
mcdermott/

Advanced Game Development with Programmable Graphics


Hardware 1st Edition Alan Watt (Author)

https://ebookfinal.com/download/advanced-game-development-with-
programmable-graphics-hardware-1st-edition-alan-watt-author/
Game development with Unity 2nd Edition Edition
Michelle Menard Digital Instant Download
Author(s): Michelle Menard; Bryan Wagstaff
ISBN(s): 9781305110564, 1305110560
Edition: 2nd Edition
File Details: PDF, 8.67 MB
Year: 2015
Language: english
Game Development
with Unity®,
Second Edition

Michelle Menard
and
Bryan Wagstaff

Cengage Learning PTR

Australia • Brazil • Japan • Korea • Mexico • Singapore • Spain • United Kingdom • United States
Game Development with Unity®, © 2015 Cengage Learning PTR.
Second Edition
CENGAGE and CENGAGE LEARNING are registered trademarks of Cengage
Michelle Menard and
Learning, Inc., within the United States and certain other jurisdictions.
Bryan Wagstaff
ALL RIGHTS RESERVED. No part of this work covered by the copyright
Publisher and General Manager, herein may be reproduced, transmitted, stored, or used in any form or by any
Cengage Learning PTR: Stacy L. Hiquet means graphic, electronic, or mechanical, including but not limited to
Associate Director of Marketing: photocopying, recording, scanning, digitizing, taping, Web distribution,
Sarah Panella information networks, or information storage and retrieval systems, except
as permitted under Section 107 or 108 of the 1976 United States Copyright
Manager of Editorial Services:
Act, without the prior written permission of the publisher.
Heather Talbot
Senior Marketing Manager: For product information and technology assistance, contact us at
Mark Hughes Cengage Learning Customer & Sales Support, 1-800-354-9706.
Senior Product Manager: Emi Smith For permission to use material from this text or product, submit
Project Editor: Kate Shoup all requests online at cengage.com/permissions.
Technical Reviewer: Michael Duggan Further permissions questions can be emailed to
Copy Editor: Kate Shoup permissionrequest@cengage.com.

Interior Layout Tech: MPS Limited


Cover Designer: Mike Tanamachi Unity is a registered trademark of Unity Technologies. All other trademarks
are the property of their respective owners.
Indexer: Larry Sweazy
Proofreader: Sam Garvey All images © Cengage Learning unless otherwise noted.

Library of Congress Control Number: 2014939188


ISBN-13: 978-1-305-11054-0
ISBN-10: 1-305-11054-4
eISBN-10: 1-305-11056-0

Cengage Learning PTR


20 Channel Center Street
Boston, MA 02210
USA

Cengage Learning is a leading provider of customized learning solutions


with office locations around the globe, including Singapore, the United
Kingdom, Australia, Mexico, Brazil, and Japan. Locate your local office at:
international.cengage.com/region.
Cengage Learning products are represented in Canada by Nelson
Education, Ltd.
For your lifelong learning solutions, visit cengageptr.com.
Visit our corporate website at cengage.com.

Printed in the United States of America


1 2 3 4 5 6 7 16 15 14
Acknowledgments

Revising this book has been quite an adventure. When Emi Smith of Cengage Learning
contacted me about this project, I felt I could do the job easily. After all, I was comfortable
with Unity, had a list of game credits, and had helped edit books in the past. It certainly
loomed larger as time passed. The months revising this book and bringing it up to date
have been an enjoyable challenge, and I could not have done it alone.
I need to thank the Unity team for their steady stream of updates and providing such a
great engine. Unity is updated frequently. The first edition was written against early edi-
tions of the 3.x Unity series. Revising it meant every sentence needed to be verified against
the current version, every screenshot updated, and every line of code validated. On finding
any place that Unity’s behavior had changed, sections needed to be rewritten. Unity’s
animation engine and particle system had been completely replaced, so the book required
effort there. The number of supported platforms had grown from three in the first edition
to over 15 potential platforms today. Even so, the book is already out of date. As this revi-
sion nears completion, the 5.x series is nearly here and will probably be released before
this book. Thanks to all of you who continue to improve the tools.
I also need to thank Emi for putting up with me. Michael Duggan, Kate Shoup, Karen
Gill, and the rest of the team have done an amazing job, and I have been impressed by
their speed and professional skills. Then there are the people I’ve never met but still
work hard to bring the book into reality; thank you to those behind the scenes at Cengage
Learning. Next, my wife Sarah also deserves thanks for pushing through the days of

iii
iv Acknowledgments

writer’s block while putting her own book writing aside. Even though it was annoying at
times, it could not have been finished without her reminders, “Turn that game off and go
work on the book.” And perhaps most importantly, thank you to the readers who will use
this book. I hope you take what you learn, continue to grow, and develop the next gener-
ation of awe-inspiring entertainment.

—Bryan Wagstaff
About the Authors

Michelle Menard is a freelance writer and a game producer. After receiving a double
bachelor of arts in applied mathematics and music from Brown University, she decided
to jump into the games industry by getting a master of fine arts in game design from the
Savannah College of Art and Design. She lives in Baltimore, MD, with her husband, two
plants, and 3,000 pounds of yarn.
Bryan Wagstaff is a game programmer. He discovered his passion for programming in
elementary school with “guess the number” style games and advanced from there. After
earning a bachelor of science in computer science from Weber State University, and grad-
uate studies in the 3D Graphics Lab at Brigham Young University, his professional career
has included programming for video games, broadcast television, interactive meeting sys-
tems, and more. He currently lives in Salt Lake City, UT, with his wife, three daughters,
and a flock of birds.

v
Contents

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii

PART I IN THE BEGINNING … . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1


Chapter 1 An Overview of the Unity Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Getting Acquainted with the Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
The Project View. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5
The Hierarchy View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8
The Inspector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10
The Toolbar. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
The Scene View. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12
The Game View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23
The Animation and Animators Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26
The Profiler and Version Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27
Customizing the Editor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28
Unity’s Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Available Unity Licenses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

Chapter 2 Your First Game: Where to Start? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31


Basic Design Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Finding the Core Idea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Brainstorming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35
Researching Other Games . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36
Paper Prototyping: It’s Not Just for Business Software. . . . . . . . . . . . . . . . . . . . .37

vi
Contents vii

Planning It All Out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38


A Basic Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38
A Simple Level Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41
Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

PART II ASSEMBLING THE GAME ASSETS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45


Chapter 3 Setting the Stage with Terrain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Unity’s Terrain Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Customizing Terrain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Building Height Using a Heightmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52
Painting Height Using Brushes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54
Painting Textures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59
Placing Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63
Cluttering It Up with Grasses and Detail Meshes . . . . . . . . . . . . . . . . . . . . . . . . .67
Terrain Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73
Lighting and Shadows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Adding a Skybox and Distance Fog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Adding Water to Your Terrain. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

Chapter 4 Building Your Environment: Importing Basic Custom Assets . . . . . . . 81


Design First, Then Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Importing Textures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82
More on Importing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83
Supported Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .88
Importing Textures for Widget’s Terrain. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Importing Basic Meshes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Setting Up Simple Shaders and Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Unity-Provided Shaders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Bumps, Spec, Cubes, and Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Assigning Shaders and Materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Making a Custom Skybox Material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Adding Water . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Helpful Tips for Working with Assets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Prefabs, Prefabs, Prefabs!. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Mass-Selecting and Grouping Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Snapping to the Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Reworking the Terrain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
viii Contents

Chapter 5 Creating Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127


Basic PC 101 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Character Capabilities in Unity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Importing Characters and Other Non-Static Meshes . . . . . . . . . . . . . . . . . . . . . . . 129
Introducing Widget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129

PART III BRINGING YOUR PROPS TO LIFE WITH INTERACTIVITY . . . . . . . . . . . . 141


Chapter 6 Scripting in Unity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
One Editor, Three Languages, a Whole Lotta Choice . . . . . . . . . . . . . . . . . . . . . . . 143
Picking a Script Editor—or, “Do You Want Autocompletion with That?” . . . . . . 145
Fundamentals of Scripting in Unity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Two Useful Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Operators and Comparisons. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Conditionals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
Variable Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172

Chapter 7 Writing the Character and State Controller Scripts . . . . . . . . . . . . . . 173


Setting It Up and Laying It Out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
A Simple Third-Person Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Controller Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
Unity’s MonoBehaviour Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Setting Up Unity’s Input Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Hooking Up the Camera . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Updating the Character Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Completed Scripts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198

Chapter 8 Hooking Up the Animations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207


Animation in Unity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Animation API. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
The Mecanim Animation System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
The Animation Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Setting Up the PC’s Animations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Defining the Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Updating the Controller. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Creating the Animation State Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
Contents ix

Creating Animations Inside Unity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216


Some Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Animation View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Setting Up a New Animation Clip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
Hooking It Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Adding Animation Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Completed Scripts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226

Chapter 9 Using Triggers and Creating Environment Interactions . . . . . . . . . . . 233


Triggers and Collision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Setting Up a Basic Trigger Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
Setting Up Other Kinds of Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
Completed Scripts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248

Chapter 10 Building Adversaries and AI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255


Artificial Intelligence: Definitely Artificial, Not Much Intelligence . . . . . . . . . . . . 255
Some Simple AI Guidelines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
A Simple Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
Setting Up a Simple Enemy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
The AI Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
A Simple State Manager for a Simple Bunny . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
Hooking Up Widget’s Attacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
Rewarding the Player for a Job Well Done . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
Spawning and Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Completed Scripts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275

Chapter 11 Designing the Game’s GUI (Graphical User Interface) . . . . . . . . . . . . 283


Basic Interface Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Steps of Interaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
Designing for Your Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
Unity’s GUI System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Sliders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Labels and Boxes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Text Entry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Toggle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Toolbars and Selection Grids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
x Contents

A Custom Skin for Widget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291


Creating the GUISkin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
Defining Custom Styles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
Importing New Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
Setting Up the HUD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
GUIContent(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
Character Displays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
Widget’s Character Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
The Enemy’s Display Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
Resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
A Sample Pop-Up Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
Adding Full-Screen Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
Completed Scripts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316

PART IV POLISH AND THE FINISHING TOUCHES . . . . . . . . . . . . . . . . . . . . . . . . . 327


Chapter 12 Creating Lighting and Shadows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
Types of Lights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
Light Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
Basics of Lighting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
Lighting the World . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
Creating Shadows. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
Lightmaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
Projector-Made Shadows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Other Light Effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
Lens Flares. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
Cookies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343

Chapter 13 Using Particle Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345


Particles: From Smoke to Stardust . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
Setting Up a Simple System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
Particle Systems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
Advanced Particle Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
Particles for Widget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
Pickup Items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
Checkpoint Activation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
Widget’s Attack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
Completed Scripts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
Contents xi

Chapter 14 Adding Audio and Music . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367


Feedback and Ambience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
Setting Up a Simple Audio Clip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
Ambient Sound Effects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
Controlling Sounds Through Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
Adding Background Music . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
The Whole Is Greater Than the Sum of Its Parts . . . . . . . . . . . . . . . . . . . . . . . . . 375
Completed Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376

PART V PUBLISHING AND DISTRIBUTING BUILDS . . . . . . . . . . . . . . . . . . . . . . . 379


Chapter 15 Basic Unity Debugging and Optimization. . . . . . . . . . . . . . . . . . . . . . 381
Debugging in Unity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
The Console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
The Log Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
Optimization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
The Profiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
Code Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
Emulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
Rendering Statistics Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
Reducing File Size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
Other Ways to Optimize Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389

Chapter 16 Creating the Final Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391


Prepping for the Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
Setting Up the Player . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
Finally, the Application Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
Build Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
Other Build Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
Asset Bundles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
Resource Folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
Packing Up Assets for Later . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
The End of the Road?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398

PART VI APPENDIXES AND OTHER RESOURCES . . . . . . . . . . . . . . . . . . . . . . . . . 399


Appendix A Shortcuts and Hotkeys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
Appendix B Common Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
MonoBehaviour . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
Transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
xii Contents

Rigidbody . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
CharacterController . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
Mathf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409

Appendix C Going Forward . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411


Design Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
Scripting Exercises. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
Art and Animation Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
Audio Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
GUI Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413

Appendix D Resources and References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415


Books. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
Scripting and General Unity Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417

Appendix E Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419


Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .433
Introduction

First things first, welcome to the Unity Engine! Whether you’re new to game development
or a seasoned pro looking into new technology, the Unity Engine has a lot to offer. Avail-
able for Mac, Linux, and Windows, the engine can create games that can be deployed on
just about any platform available, from the Web, to the Xbox and PlayStation (if you are a
licensed developer), to mobile devices like smart phones and tablets. The easy interface,
friendly development environment, and wide-ranging support of all popular gaming plat-
forms make it a great choice for the student, indie, and larger developer team.
Unity’s clients include such names as Ubisoft, Disney, and Electronic Arts, but the engine
is also highly utilized by small independent studios, hobbyists, students, and even compa-
nies outside of the gaming industry for medical simulations and architectural walk-
throughs. Whatever the end goal, Unity allows anyone, regardless of background, to
create fun, interesting, and interactive content. Let’s get started.

What Will Be Covered (And What Won’t)


This book is an introductory look into the engine. It explains what Unity has to offer and
gives a few pointers on how to best use its capabilities for whatever it is you want to do. If
you’re a hobbyist or student, you’ll probably want to start reading from the beginning and
follow along with the example project. If you’re using this book as a tool to evaluate
whether the engine is right for you, you’re probably best skipping around to the relevant
chapters.

xiii
xiv Introduction

If you start from the beginning, you’ll learn all the important interface commands, how to
set up and organize your project, and all the basics of getting a 3D game up and running,
from character importation to scripting to audio. After completing the sample project,
you’ll have all the skills necessary to go out and make your own games.
What this book isn’t is a crash course in the Unified Theory of Game Development and
Design. By that, I mean you won’t be granted some mystical information or mad skills for
everything there is to know in design, programming, art, or sound. Each topic covered
(such as game design) does include some basic theory and information—enough to get
you going on a working vocabulary and introductory concepts. This book won’t make
you a star designer or a world-class programmer, however. That requires years of study
and practice.
If, after reading, you do find yourself interested in a particular field, check out Appendix D,
“Resources and References,” for pointers on where to get more information. Think of this
as a sampler course stretching across multiple cuisines, not an in-depth exploration of one
particular food type. More advanced and singular topics such as network integration and
discussions on Unity’s shader language are also not covered.

Intended Audience
So, who exactly is this book for, anyway? If you fall into any of the following categories,
you’ve come to the right place:
n A solo developer or generalist looking for some well-rounded information on
utilizing the engine
n A developer looking to evaluate the engine for use in future projects
n A hobbyist needing a how-to guide about some specific areas
n A student (or prospective student) wanting to know whether game development is
right for you
n Anyone looking to build a game portfolio using an affordable (or in some cases free)
professional engine
As stated, all the game development sections cover some basic background knowledge and
go over a few key terms. However, the text does assume some knowledge or skills in a few
areas if you plan to work away from the sample project. For example, creation of 3D art
assets and how to use a 3D modeling package are not covered. All the required models
used in the text (and then some) are included on the companion website (more on that
Introduction xv

in a moment), but their creation is not described. If you stick to the sample project while
reading the book, you won’t really need any outside knowledge or skills (although any
game development information is a plus). If you plan to work on your own project from
the start using this book as a guide, then you’ll need to educate yourself in the other areas
of development or find other places and people to provide art and code. If creating models
and animations isn’t your thing, the Unity Store has a wide range of assets for free and for
sale, and there are many communities out there who can help you develop your own.

The Book’s Structure


The information in the book is organized into five parts, each covering a general aspect of
game development. Within each part, chapters are devoted to each single concept, such as
one chapter for AI development and another for particle effects. If you need help on a spe-
cific area of Unity, go to the corresponding chapter or use the handy index. The appen-
dixes include a list of common and helpful shortcut keys, a rundown of the most-used
classes, and exercises for you to complete if you want a few pointers on what to do once
you finish reading. A compiled glossary for all keywords introduced in the text is also con-
tained there.
I’ve tried to make learning the engine a little more straightforward by using some general
formatting guidelines. Steps for you to complete in the engine always appear in numbered
lists. If you see such lists coming up on the page, you should open Unity to follow along.
Links between steps in a folder chain or nested menu are marked with the > symbol. So
the line “My Documents > My Unity Project” would mean to open the My Documents
folder and then open the folder My Unity Project contained within it. Pretty straightfor-
ward. Code to write in the engine is blocked off in its own formatting, as shown here:
//I’m a comment
Update()
{
print("Hello World");
}

Finally, some extra information is included in the form of sidebars. These mostly cover
more advanced technical data or engine specs and aren’t required knowledge for using
the engine on a day-to-day basis. They do tend to be helpful, however. Also be mindful
of tips, notes, and warnings scattered throughout the text. These are often important, con-
taining information about common pitfalls and helping to stave off potentially hard-to-fix
xvi Introduction

disasters. If time was taken to graphically embellish something, it’s probably worth a sec-
ond look.

Installation Instructions
Installing Unity is quick and painless and technically requires an Internet connection.
Unity comes in two flavors, Unity Basic, which is free, and Unity Pro. Both are regularly
updated by developers. Although you won’t need the Internet again after activation, it is
advisable to have a connection if only for the patch updates and fixes.

The Unity Engine


First up, install Unity. You can download Unity from the Unity Technologies website:
unity3d.com/. From the Download menu, click on either the Mac or Windows version
button, whichever is right for you. (This book uses the Windows version for all its
examples.) You can choose to download the free Unity Basic version directly or get a
Unity Pro license trial version, which is free for 30 days. It doesn’t really matter as far as
the book is concerned, but it can be fun to see what goodies the Pro version includes.
Note that Unity has grown to include many features and these features require space. The
installer is about 1 GB. The download time will depend on your Internet connection. A
fast broadband connection can usually handle the transfer in a few minutes.
Once the download is complete, run the UnitySetup-###.exe file, accept the terms of
agreement, and follow the onscreen command prompts. When you get to the Choose
Components screen, shown in Figure I.1, make sure the Example Project checkbox is
selected. You’ll probably also want to select the Unity Development Web Player checkbox
as well, in case you ever want to publish your games to the Internet. In addition, consider
selecting the MonoDevelop checkbox even if you have your own development environ-
ment because the bundled version of the MonoDevelop editor has some specialized fea-
tures that are hard to get in other editors. If you change your mind later you can re-run
the installer to add or remove components. Then click Next and finish the installation.
Introduction xvii

Figure I.1
All components are selected by default, requiring nearly 5 GB of space.
Source: Unity Technologies.

Use the default install path or select your own, and then click Install. Unity takes nearly
5 GB of install space, so make sure your selected destination can handle this plus any
other add-ons or projects you want to use later. Follow the other onscreen instructions
to complete the install.
After the install has finished, Unity will prompt you to register your copy. For the free
version and trial Pro, this is easy. Select the Internet registration version (if available)
and fill out the form on the website the engine takes you to—usually it’s just your name
and email address. After this, Unity is yours to use.
Once the engine has finished installing, it’s time to move on to the contents of the com-
panion website.
xviii Introduction

Using the Companion Website


To access the book’s companion website, visit www.cengageptr.com/downloads, and type
the name of this book in the Search field. The companion website is divided into a few
main sections:
n Chapters: This folder contains subfolders for each chapter in the book, whenever
they require the use of files or assets. You can either copy the entire Chapters folder
to your hard drive now or just grab the individual files when you need them. The text
always specifies when a file is needed and where to grab it.
n Design Documents: This folder houses all the basic information for the sample
project discussed in the text, a game called Widget. When the text says to view the
Design Docs, they’re located in here.
n Shader Test: A sample project detailing and comparing the basic shaders side-
by-side that are available in Unity. If you’re not sure which shader to use or how
some shaders may interact in a specific lighting rig, modify and use this file as
needed.
n Final Project Files: Unlike the Chapters folder, which houses all the individual files
as they come up in the text, the Final Project Files folder is a complete Unity project
for the Widget game. If you ever get stuck or want to see how something fits together
later, you can always check out the game here. Extra assets such as more models,
textures, and UI elements are also included here for any further expansion you may
want to pursue.

Optional Installs
Between Unity and the contents of the companion website, you can complete every exer-
cise in this book and get the sample project up and running. However, you may find your-
self wanting to tweak a graphic or texture here or there, or maybe even sculpt a new
model to import. Many free software packages are described both in the text where appro-
priate and in Appendix D. If you don’t already have something installed on your com-
puter, check the appendix for information and a link.
Unity includes MonoDevelop, a free code editor to use for scripting, but you can use your
own favorite coding environment if desired. Chapter 6, “Scripting in Unity,” covers com-
patible ones in more detail, and Appendix D also provides links where appropriate.
Introduction xix

Parting Words of Wisdom


You probably have tons of great game ideas floating around in your head. Maybe you’ve
even started working on one, the big one that’ll net you that dream job or needed raise.
Maybe you have built some small projects in the past and want to use a comprehensive
engine rather than doing everything yourself. Or perhaps you’ve started two games, or
three, or…you get the picture. Working on making your snippets of ideas and musings
into playable games is great—but how many have you actually finished? Making a game
is a huge commitment, fraught with tons of unforeseen setbacks, design changes, and soft-
ware explosions, all for a tiny little bundle of ideas that you hope others will love as much
as you do. It’s far too easy once the first dragon rears its head to stop working, take an
extended break, and never return to the field to try again. It’s not procrastination, you
tell others, it’s just a short time away to rest your eyes, to let your ideas simmer free of
worry. The short break becomes a week, and then a month, and years roll by as your little
unfinished game collects dust in the corner.
Tackling the problems in game development is hard work. Sometimes you follow a trail of
ideas and discover barriers that need to be climbed, worked around, or pushed through.
Other times you need to admit that the idea was wrong, it didn’t work out as expected, or
it’s just plain un-fun. Don’t walk away from the whole project and leave the game unfin-
ished. Try something else, even if you’re unsure where this new path will take you. Maybe
it won’t work out, but maybe it’ll be the solution to a whole host of problems. Try, make
mistakes, learn, and try again. Be willing to make mistakes and learn from them, and keep
fighting your way through until the game is complete. No game is perfect and defect-free,
but you can reach the point where you can say it is complete.
Finish that game, and then finish another. It doesn’t matter if you think they’re horrible,
terrible piles of swill you’d be embarrassed to show your own mother. Show her anyway.
They may suck, or they may not. Either way, analyze what you did that worked and didn’t
work. The process is as much about learning as it is about creating, and no one ever
excelled by stopping halfway. If you get discouraged, it is okay to take a break, but always,
always come back to it in the end. Support from friends can help greatly in this—involve
some of your buddies in rounds of routine play tests. Make a party of it. Celebrate what
you do and remember to have fun. If you’re not having fun, you’re probably not making
fun!
xx Introduction

One late night, as we were pushing to finish a game, I was sitting in the cafeteria, dining
with co-workers on a large tray of studio-provided “mystery nuggets” for dinner. Some-
one said, “It is eight o’clock at night and I’m still at work on this crazy project that never
seems to end. I could be spending time on so many other things. Will you remind me why
we are still here?” Another co-worker spoke up, and his reply was heartfelt: “Because we
love it. No matter how many problems we encounter and difficulties we overcome, we
love it. We love creating these amazing games that entertain millions of people. We are
artisans, passionate about doing our best on every task. We are not just working late and
eating deep-fried mystery nuggets; we are building a game to inspire, to entertain, and to
give the world something that they may savor and enjoy. Just like the mystery nuggets,
most people will have no idea what is inside, but when they play the game they can be
entertained and enjoy a moment of life. That makes the difficulties worthwhile.”
Be passionate. Development is work and sometimes it is difficult. Sometimes it is painful.
Sometimes you will be disappointed and unsatisfied with the results. Just keep pushing,
sharing your passion, and doing your best work. Game development is a powerful career.
We create new worlds, teach, entertain, and inspire. We start with a blank file and finish
with a product that can change the world. Be a game developer.
Part I

In the Beginning …

As with any new endeavor, it’s usually best to start somewhere in the beginning. And
before you even start, it’s best to lay out your tools and get your ideas in order. You
wouldn’t attempt (I hope) to build a house without a blueprint, and games are no differ-
ent. The best game ideas in the world won’t get you very far unless you have the knowl-
edge, skills, and discipline to see them fully realized and implemented.
Before Unity, making a game from scratch for the newbie game designer was a rather
daunting process. Engines, especially free ones, weren’t terribly easy to come across, and
those that were often suffered from poor execution or lack of documentation. Now with
Unity, you can quickly get your ideas in motion, even if you lack a strong art or program-
ming background.
In this part, you’ll learn the basics of the engine and its interface, as well as how to refine
your game idea from the get-go, hopefully saving you some time and energy later in the
process.

1
This page intentionally left blank
Chapter 1

An Overview of the
Unity Engine

Unity is a powerful integrated game engine and editor, enabling you to quickly and effi-
ciently create objects, import external assets, and link them all together with code. The
editor is visually driven and built around the principles that you can do everything with
a simple drag-and-drop motion—even connect scripts, assign variables, or create compli-
cated multi-part assets. Unity also boasts an integrated scripting environment, built-in
networking capabilities, and the ability to build and deploy for multiple platforms. All of
this is wrapped up in a simple, intuitive, and customizable workspace.

Getting Acquainted with the Interface


Before diving headfirst into making your first game with Unity, it’s worth the time to first
take a quick look at how to get around in the editor. Unity may look a bit daunting when
you first open it, but you’ll find that you can easily master its basics in a day.
If you haven’t done so already, open Unity. Choose Start > Programs > Unity (C:\Program
Files\Unity\Editor\Unity.exe) or click the desktop icon if you created one. Then load the
Ch1_TestFile.unity file located on this book’s companion website to follow along. Figure
1.1 shows the Unity environment.

3
4 Chapter 1 n An Overview of the Unity Engine

Figure 1.1
The Unity environment after you load the Chapter 1 sample. By the end of the chapter, you will understand all the
parts you see on the screen.
Source: Unity Technologies.

Note
If you installed one of the demos with the engine, a scene from the demo will load by default until you either
load a different scene or create a new one.

The editor’s default layout is broken into a series of different panes and tabbed windows
called views. Each view details a specific aspect of the editor and allows you to perform
different functions when working on your game. If you’ve used a 3D modeling program
or other game editor in the past, you may find some of this familiar.
Getting Acquainted with the Interface 5

You can rearrange the views to suit your preferences. Views can be repositioned, resized,
and even broken off to their own separate windows. Several presets can be found in the
menu under Window > Layouts. Depending on the size of your monitor, you might prefer
the Wide layout or the Tall layout, or you might decide to create your own. Don’t worry
about getting the settings wrong; you can always reset the Unity views back to the default
layout by selecting Window > Layouts > Revert Factory Settings.

The Project View


All of a game’s files—scripts, objects, scenes, anything and everything—are organized into
a Project folder, each of which contains an Assets folder. The Assets folder houses every-
thing you’ve created or imported to include in your game—meshes, textures, scripts, cam-
eras, levels…everything. (See Figure 1.2.) The Project View panel displays this Project
folder and the incorporated Assets folder.

Asset preview icons

Tab name Search bar Window options

Quick
Creation menu

Favorites

Asset tree

Icon Scale slider

Figure 1.2
The Project view.
Source: Unity Technologies.
6 Chapter 1 n An Overview of the Unity Engine

The Project view displays everything included in the game’s Assets directly, exactly how
they are organized and arranged on your computer’s hard drive. If you are unsure, how-
ever, of where these files are located (or if you ever forget), you can simply right-click any
selected asset in the Project view and select Show in Explorer.
Arrows next to folders indicate nested layers. Clicking any one of these will expand that
folder’s contents. You can also Shift-click an arrow to fully expand or contract its con-
tents. Moving and organizing files into different folders can be achieved in the Project
view with a simple click and drag.
Caution
Be careful about moving your asset files around outside the Unity Editor. In fact, avoid it at all costs. If you
need to reorganize or move an asset, do it from within the Project view. Not doing so could break or remove
any metadata or links associated with that asset, possibly breaking your game in the process.

When you select an asset folder or a Favorites folder, the preview icons update to show
you the folder’s contents. Use the Icon Scale slider to change the size of the icons. If you
slide the Icon Scale slider all the way to the left, the display will change from icons to a list.
Each type of object listed also has its own descriptive icon or thumbnail, making it easy to
quickly scan the contents. Many assets, like directories, source code, and general data files,
use a standard icon. Other assets, like Photoshop images, 3D models, textures, and mate-
rials, display a thumbnail preview of the asset in the file.
The Search bar enables you to quickly find assets directly by name. The three buttons on
the right side of the Search bar let you search by type, search by tag, and save the search as
a favorite. On a small project, you can usually remember where all your assets are located.
But when a project contains hundreds or even thousands of assets, using the search tool is
the easiest way to find what you need. The Project view’s list will dynamically update after
each letter you type, allowing for easier browsing if you don’t quite remember the asset’s
exact name.
You can open and edit files directly from within the Project view. If you find you need to
tweak or correct something in any file (like a Photoshop file), simply double-click the file
to open it in its default editor. Save the file normally to have Unity import it back into
your project.
Sometimes you’ll find it necessary to make new assets or objects that aren’t contained
already in your Project view. Unity makes this easy from within this view—simply click
the Quick Creation menu to bring up the available options. This shortcut menu is located
Getting Acquainted with the Interface 7

right beneath the Project tab. From here, you can make new folders, empty script files, or
other game-specific objects without having to leave the editor. Right-clicking in the Project
view itself will also give you a link to the Quick Creation menu and its options, placing the
new file at your current location in the file tree.
Tip
To rename any file or folder, you can click twice slowly on the name (not a normal fast double-click) or select
the desired file and press the F2 key. Then start typing. Press Enter when you are done renaming your file.

Right-clicking in the Project view will bring up a few advanced options, including asset
importation, syncing with external project controllers, and asset package manipulation.
See Figure 1.3. These are covered in more depth in later chapters.

Figure 1.3
The right-click menu and Import Package menu options.
Source: Unity Technologies.
8 Chapter 1 n An Overview of the Unity Engine

All tabbed windows have a Windows Options drop-down list, allowing you to maximize
the selected view, close the viewed tab, or add another tab view to the window. Click the
icon to bring up the available options.

The Hierarchy View


Whereas the Project view lists all the objects and files available in your game, the Hierar-
chy view lists just the ones you’re actually using in the current scene. The objects in the
scene are listed alphabetically. As you add or remove objects from your game, the Hierar-
chy view will update with each change. Selecting an object in the Hierarchy view and
pressing the Delete key (or right-clicking and selecting Delete) will remove the object
from your current scene in the game, but not from the project’s Assets folder. Figure 1.4
shows the game’s current contents as an example.

Figure 1.4
The Hierarchy view, showing the game scene’s current contents.
Source: Unity Technologies.

Each instance (a copy or occurrence) of an asset will be listed individually, so good naming
conventions are especially important. If you have 30 instances of an object all named Cube,
Getting Acquainted with the Interface 9

you may have trouble finding the one you want later. You can rename any object in the
Hierarchy view independently of its actual filename in the Project view. A simple mesh
named Cube in your Project view can then be instanced and renamed in the Hierarchy view
to anything you want, like Crate, Box, or Mystery Pickup23, making it easier to find and use
later. Note that this will not update the filename of the actual object in the Project view or on
your computer. To do that, you must change the name from within the Project view.
Parenting objects together in the Hierarchy view can also help with organization and
make editing your game easier. When you parent objects together, you are basically link-
ing a collection of unrelated objects together in a group under a single object, the parent.
All the objects under this parent are called its children, or child objects. See Figure 1.5.

Unparented objects
Parent object

Child objects

Figure 1.5
Parented and unparented objects.
Source: Unity Technologies.

In the example, the parent object is an asset called Primitives, under which three child
objects are located: Sphere, Cube, and Plane. Clicking the arrow next to Primitives will
expand or collapse the group, much like with the folders in the Project view. However,
parenting gives you one other important benefit besides a speedy way to group like objects
together: Moving or manipulating the parent object will in turn do the same to all the chil-
dren underneath it. They are said to inherit the parent’s data. The child objects can still be
edited independently of each other and the parent object, giving you more control.
If you’re still uncertain about parenting, think of a normal person’s body. An arm is par-
ented to the torso, and a hand is parented to the end of the arm. Moving the torso forward
(the parent) will move the arm with it, which will in turn move the hand (the two children).
However, you can move and rotate the hand around without moving the torso or the arm.
Using parented objects can make moving large numbers of objects around much easier
and more precise, and should be used whenever possible. A few more advanced concepts
of parenting will be covered in Chapter 4, “Building Your Environment: Importing Basic
Custom Assets” and Chapter 6, “Scripting in Unity.”
10 Chapter 1 n An Overview of the Unity Engine

The Inspector
The Inspector, as its name suggests, displays the detailed information contained in each
object in your game (see Figure 1.6). Click the Sphere object (you may need to expand
Primitives to see it) to bring up its details in the Inspector view.

Context menu

Help button

Figure 1.6
The Inspector view for the Sphere object.
Source: Unity Technologies.
Getting Acquainted with the Interface 11

On first glance, this may seem overwhelming, but all Inspector views follow the same
basic principle for each object. At the top of the Inspector is the object’s name, followed
by a list of the different properties of the object, such as Transform and Sphere Collider.
Each of these different kinds of properties will be discussed in greater detail later. For
now, just know that this is where you come to edit any piece of information about your
object.
Each property in the Inspector has a Help button and a Context menu attached to it.
Clicking the Help button will bring up the related document for the property in the refer-
ence manual. Try it with any one of the properties. Clicking the Context menu will give
you specific options related to just that property, as well as a way to reset the property
back to its default values.
Note
You will need an active Internet connection to view the reference manual when you click the Help button,
because it is hosted online at Unity’s website.

The Toolbar
The Toolbar, shown in Figure 1.7, consists of the available menus and five basic control
groups for your game. The menus along the top of the editor contain the basic generic
options available to you and are grouped by function. They are as follows:

Transform Transform Play Layers Layout


tools Gizmo toggles Controls group drop-down list drop-down list

Figure 1.7
The Toolbar.
Source: Unity Technologies.

n File menu: Use this menu to open and save scenes and projects and to create builds
of your game.
n Edit menu: This menu contains the normal copy and paste functions, as well as
selection setups and settings.
n Assets menu: Everything having to do with creating, importing, exporting, and
syncing assets can be found in this menu.
12 Chapter 1 n An Overview of the Unity Engine

n GameObject menu: This menu is for creating, viewing, and parenting GameObjects.
n Component menu: This menu is for creating new components or properties for
GameObjects.
n Window menu: Use this menu to bring up specific views (such as the Project or
Hierarchy view) and to switch to saved window layouts.
n Help menu: This menu links to the manuals, community forums, and a page where
you can activate your license.
Sometimes Unity will add menus for you to access functions when editing terrains, ani-
mations, or other items. For now, just be aware of the general functionality contained in
each menu. The individual aspects will be discussed in detail as they’re needed.
The control tools are also grouped by function, and serve primarily to assist with editing
and movement in the Scene and Game views, discussed more fully next. These tools are as
follows:
n Transform tools: These are used in the Scene view to control and manipulate
objects. In order from left to right, they are the Hand tool, Translate tool, Rotate tool,
and Scale tool.
n Transform Gizmo toggles: These change how the Transform tools work in the Scene
view.
n Play Controls group: You use these to start and stop testing a game from within the
editor.
n Layers drop-down list: This controls which specific objects are displayed in the
Scene view at any given time.
n Layout drop-down list: This changes the layout of your windows and views and
saves any custom layouts you create. It also serves as a shortcut to the Window >
Layouts list.

The Scene View


One of the most important windows in the editor is the Scene view—a visual representa-
tion of your game world or level (see Figure 1.8). This is where you’ll maneuver, manipu-
late, and position all your objects and assets listed in the Hierarchy view, creating the
physical space that your players will explore and interact with.
Getting Acquainted with the Interface 13

Figure 1.8
A simple Scene view.
Source: Unity Technologies.

As you can see, the objects listed within the Hierarchy view are displayed in all their bril-
liance in the Scene view. You can click the object’s name in the Hierarchy view to select it
or just manually click it in the Scene view. Clicking the different objects in the Scene view
or Hierarchy view will update the Inspector with the object’s appropriate data.
Note
If you see lists of items populating your Hierarchy view but the Scene view appears to be empty, your view may
be zoomed out too much to view the individual assets. To fix this, select an item in the Hierarchy view, move
and hover your mouse over the Scene view, and press the F key to zoom in to the object.

Note that by clicking the Primitives object in the Hierarchy view, you actually select all the
child objects in the Scene view. There isn’t a separate Primitives object displayed in the
Scene view. If you want to select an entire parented group of objects, you must do so
through the Hierarchy view.
14 Chapter 1 n An Overview of the Unity Engine

Camera Navigation
Learning to move around quickly in the Scene is one of the most important aspects of the
editor to master. (If you’re an Autodesk Maya user, you’ll be right at home with these
controls.) You can think of the Scene as the output or focus of a virtual camera. To
move around the scene, you move your camera’s view around as you look at different
objects. The controls are as follows:
n Tumble (Alt-click): The camera will pivot around all axes, thus “tumbling” the view.
n Track (Alt–middle mouse button click): Moves the camera left, right, up, and down
in the scene.
n Zoom (Alt–right click or mouse scroll wheel): Zooms the camera in and out of the
scene.
n Flythrough mode (press the W, A, S, or D key while pressing the right-mouse
button): The camera will enter a “first-person” mode, allowing you to quickly move
and zoom around the scene.
n Center (click the desired GameObject and press the F key): The camera will zoom
in and center on the selected object in the view. Your mouse cursor must be located
in the Scene view, not over the object in the Hierarchy view.
n Full Screen Mode (spacebar): Press the spacebar to make the active view take up all
available space in the editor. Press it again to return to your previous layout. The
active view is whichever one your mouse is hovering over.
If your mouse has only one button (or if you only want to use your left mouse button),
you’re not at a complete loss. Select the Hand tool from the Toolbar (or press the Q key
on your keyboard) to put your mouse in Move mode. Then use the following commands:
n Tumble (Alt-click): The camera will pivot around all axes, thus “tumbling” the view.
n Track (click and drag): Click and drag to move the camera left, right, up, and down
in the scene.
n Zoom (Ctrl-click): Zoom the camera in and out of the scene.
Getting Acquainted with the Interface 15

Try the different movement controls until they become comfortable and second nature.
Being able to quickly move around your game scene with precision will make your devel-
opment time much faster and more enjoyable.
The Scene view also contains a special tool called the Scene gizmo, shown in Figure 1.9.
This special tool gives you fast access to the scene camera’s orientation, allowing you to
quickly change the view to premade selections.

Figure 1.9
The Scene gizmo.
Source: Unity Technologies.

Buzzword
A gizmo is an icon or symbol often used for something that doesn’t have a visual representation in the real
world. In 3D programs like Unity, gizmos are often used to represent movement and camera controls.

Try clicking the different arrows on the Scene gizmo and watch how the Scene view
updates. Each arrow changes the camera’s view to one of the different orthogonal, or 2D,
directions, like Top, Back, Front, or Right (see Figure 1.10). Sometimes you’ll need to
change to one of these views to properly line up an object in the scene.
16 Chapter 1 n An Overview of the Unity Engine

Figure 1.10
The four main orientation views.
Source: Unity Technologies.
Getting Acquainted with the Interface 17

Note
The Plane object seems to disappear in some of the side views because it is a 2D object. That is, planes are
defined only along two axes and don’t have height. If ever your 2D objects seem to disappear, switch to a
different orthogonal view.

Click the center cube icon on the gizmo to switch between Perspective and Isometric
views. If you Shift-click the center cube of the gizmo, you’ll enter a Perspective view. The
gizmo uses three diverging lines to indicate Perspective mode and three parallel lines to
indicate Isometric mode. Perspective view emulates real-world perspective sight, where
objects get smaller as they become farther away. Notice that in Isometric view, the objects
do not change size or shape as they become farther away. They remain the same uniform
size. This camera view lacks the emulation of perspective. You may recognize this look
from many older games. See Figure 1.11.

Figure 1.11
Isometric versus Perspective view.
Source: Unity Technologies.
18 Chapter 1 n An Overview of the Unity Engine

Each of the arrows is color-coordinated to match one of the axes of the game world: red
for the X axis, green for the Y axis, and blue for the Z axis. Unity’s world space is set up in
a Cartesian coordinate system—the X and Z axes form the ground plane, and the Y axis
defines the height of the world. The center of the world is located where these three axes
intersect at the origin, the point (0,0,0). This is common vector notation for X ¼ 0, Y ¼ 0,
Z ¼ 0, or more generally, (X, Y, Z).
Note
If you’re more comfortable using different colors than the defaults to denote the world axes, you can change
them to anything you like by choosing Edit > Preferences > Colors.

Scene View Controls


The Scene view’s Control Bar, shown in Figure 1.12, changes the way you view the scene.
The default values give a good approximation of what your scene would look like ren-
dered in game, as well as displaying a handy grid to help position and move objects.

Render Modes Effects


drop-down list drop-down list

Draw Modes 2D, Lighting, and Gizmos drop-down list Search box
drop-down list Audio toggles

Figure 1.12
The Scene view’s Control Bar.
Source: Unity Technologies.

While the default view is very useful, sometimes you will want to change what you see
during development. The Control Bar lets you change many different options. The set-
tings do not affect the built game, so switch them around as much as you need to help
you with your project.
The first drop-down list, Draw Modes, controls how the objects are drawn in your scene.
The default value is Textured—the objects are drawn using the colors and texture maps
assigned to them. Click the menu to change the draw mode. You have the following options:
n Wireframe. Wireframe mode shows the objects’ meshes without textures attached.
n Textured Wire. Textured Wire mode shows the textures with their wireframes
overlaid.
Getting Acquainted with the Interface 19

n Render Paths. This mode allows you to see objects assigned to deferred lighting or
forward rendering. (Both of these are advanced settings.)
n Lightmap Resolution. This mode is a tool for artists to preview how lighting will
appear.
None of these selections change the way your game will display, only how the Scene view’s
camera views the objects.
The Render Modes drop-down list is useful for optimizing your game scene by fine-
tuning your objects. The options are as follows:
n RGB. The default value, RGB shows all the objects colored as normal.
n Alpha. Selecting Alpha will show all the objects in the scene by their alpha values.
Fully opaque objects will render as white, fully transparent objects will render as
black, and objects that are partly translucent will render in different shades of gray.
n Overdraw. Overdraw shows how much of the screen is being overdrawn—in other
words, it shows you objects being drawn behind others.
n Mipmaps. This is a tool to help you find the ideal texture sizes for your objects.
Objects drawn in blue have textures that are too small and objects drawn in red have
ones that are too large.
Just like the draw modes, none of these selections change the game will display, but only
change that Scene view’s content.
The Lighting button toggles whether the Scene view uses the default built-in lighting or
your own implemented lighting. If you haven’t placed a light source in the scene yet,
using the built-in lighting setup can be useful. The 2D button switches between 2D and
3D in the Scene view window. If you are building a 2D game scene, you can still manipu-
late objects in 3D space to order their visual depth, so toggling between 2D and 3D is very
useful. The Audio button toggles whether audio effects should be played for the view.
The Effects drop-down list allows you to show or hide certain visual effects. Sometimes it
is difficult to see objects in the scene when you have fog, flares, or other effects visible.
Changing the visibility of the effects in the Scene view can be useful in complex scenes.
The Gizmos drop-down list is similar to the Effects drop-down list, enabling you to show
or hide items in the Scene view. Inside the drop-down list are several adjustments you can
make to the gizmos. The 3D Gizmos checkbox toggles between using the real 3D position
of the object versus drawing the gizmo as an overlay on top. The slider will adjust the size
Exploring the Variety of Random
Documents with Different Content
the author’s talents cannot overcome. I would rather be the poorest
Greek whose fate he commiserates, than Lord Byron, if this poem be
a true transcript of his feelings. Out of charity we must hope that his
taste only is in fault, and that the young lordling imagines that there
is something interesting in misery and misanthropy. I the readier
believe this, as I am intimate with one of his lordship’s most attached
friends, and he gives him an excellent character.” The “intimate
friend” alluded to was William Harness who, from the Harrow
schooldays onwards, was chief among Byron’s friends; indeed,
Byron expressly desired to dedicate Childe Harold to Harness, and
only refrained “for fear it should injure him in his profession,”
Harness being then in Holy Orders while Byron’s name was
associated with orgies of dissipation, to be followed later by
calumnious charges which Harness nobly did his best to refute.
It is a tribute to Miss Mitford’s critical faculty that she found little
difficulty in probing the mystery as to the authorship of Waverley, that
“half French, half English, half Scotch, half Gaelic, half Latin, half
Italian—that hotch-potch of languages—that movable Babel called
Waverley!” as she termed it. “Have you read Walter Scott’s
Waverley?” she writes. “I have ventured to say ‘Walter Scott’s,’
though I hear he denies it, just as a young girl denies the imputation
of a lover; but if there be any belief in internal evidence, it must be
his. It is his by a thousand indications—by all the faults and by all the
beauties—by the unspeakable and unrecollectable names—by the
hanging the clever hero, and marrying the stupid one—by the praise
(well deserved, certainly, for when had Scotland such a friend! but
thrust in by the head and shoulders) of the late Lord Melville—by the
sweet lyric poetry—by the perfect costume—by the excellent
keeping of the picture—by the liveliness and gaiety of the dialogues
—and last, not least, by the entire and admirable individuality of
every character in the book, high as well as low—the life and soul
which animates them all with a distinct existence, and brings them
before our eyes like the portraits of Fielding and Cervantes.”
She was, however, at fault over Guy Mannering, being thrown
clear off the scent by Scott’s cleverness in quoting a motto from his
own Lay of the Last Minstrel, an act of which Miss Mitford evidently
thought no author would be guilty: “he never could write Guy
Mannering, I am sure—it is morally impossible!”
Pride and Prejudice and Sense and Sensibility she joined with
others in ascribing to any but their real author, but when she learned
that they were Miss Austen’s she let her pen go with a vengeance.
“A propos to novels, I have discovered that our great favourite,
Miss Austen, is my countrywoman; that mamma knew all her family
very intimately; and that she herself is an old maid (I beg her pardon
—I mean a young lady) with whom mamma before her marriage was
acquainted. Mamma says that she was then the prettiest, silliest,
most affected, husband-hunting butterfly she ever remembers; and a
friend of mine, who visits her now, says that she has stiffened into
the most perpendicular, precise, taciturn piece of ‘single
blessedness’ that ever existed, and that, till Pride and Prejudice
showed what a precious gem was hidden in that unbending case,
she was no more regarded in society than a poker or a fire-screen,
or any other thin or upright piece of wood or iron that fills its corner in
peace and quietness. The case is very different now; she is still a
poker—but a poker of whom every one is afraid.” Fortunately this
description was qualified: “After all, I do not know that I can quite
vouch for this account,” especially as the consensus of opinion
regarding Miss Austen is entirely opposed to the above description.
Miss Edgeworth she found too cold and calculating as a writer: “I
never can read Miss Edgeworth’s works without finding the
wonderful predominance of the head over the heart; all her
personages are men and women; ay, and many of them very
charming men and women; but they are all of them men and women
of the world. There is too much knowledge of life, too much hardness
of character—too great a proneness to find bad motives for good
actions, too great a contempt for that virtuous enthusiasm, which is
the loveliest rose in the chaplet of youth; and, to say all in one word,
I never take up her volumes myself without regretting that they were
not written by a man; nor do I ever see a young girl reading them
without lamenting that she will be let into the trick of life before her
time.”
Early in the year 1813 a letter was received from Mr. and Mrs.
Perry, inviting Miss Mitford to stay with them at their house in
Tavistock Square. Mr. Perry was then Editor of the Morning
Chronicle, and the invitation was gladly accepted, not only because
Perry was a friend of her father’s, but because the latter had assured
her that Tavistock House was the rendezvous for many of the
leaders in the political and literary worlds. During this visit she met
Mrs. Opie—“thinner, paler, and much older, but very kind and
pleasant”—and Thomas Moore,—“that abridgement of all that is
pleasant in man,”—with whom she had the “felicity” of dining
frequently. “I am quite enchanted with him,” she wrote. “He has got a
little wife (whom I did not see) and two little children, and they are
just gone into Wales,[17] where he intends to finish a great poem [
Lalla Rookh] on which he is occupied. It is a Persian tale, and he
says it will be his fault if it is not a fine work, for the images, the
scenery, the subject, are poetry itself. How his imagination will revel
among the roses, and the nightingales, and the light-footed Almé!”
Mr. Moore did not forget his little friend and, a year later, gave her
the added pleasure of reading over a part of his manuscript, “and I
hope in a few days to see the whole in print. He has sold it for three
thousand pounds. The little I have seen is beyond all praise and
price,” she wrote enthusiastically. These visits to town were
undoubtedly something more than mere pleasure jaunts, for it is
quite apparent that they were undertaken with a view to keeping the
name and person of Mary Russell Mitford well in the public mind and
eye. Making her headquarters at 33, Hans Place, the residence of
Fanny Rowden’s mother, she spent a whirling fortnight during the
summer of 1814, meanwhile keeping Mrs. Mitford well-informed on
all details, however slight. Under date, June 16, 1814, she writes:
“Yesterday, my own dearest Granny, was, I think, the most fatiguing
morning I ever underwent. Stuffed into a conspicuous place, stared
at, talked to, or talked at, by everybody, dying with heat, worn out
with flattery, I really should have wished myself in heaven or
somewhere worse, if I had not been comforted by William Harness,
who sat behind me, laughing at everybody, and more playful and
agreeable than any one I ever remember.” The occasion was the
Midsummer Breaking-up performance at her old school, during
which an ode she had composed for another function was recited.
“We had no exercises,” she continued, “nothing but music and
recitations, which lasted nearly four hours, and did them great credit.
The March of Mind was well repeated, and received, of course, as
verses commonly are in the presence of the authoress. I was to have
presented the prizes; but to my great comfort Lady Caroline Lamb
arrived, and I insisted on giving her my post.” Then follow particulars
of a carefully-planned programme of sight-seeing, finishing with:
—“How little people in the country know of fashions! I see nothing
but cottage bonnets trimmed with a double plaiting, and sometimes
two double plaitings, and broad satin ribbon round the edge. Gowns
with half a dozen breadths in them, up to the knees before, and
scarcely decent behind, with triple flounces, and sleeves like a
carter’s frock, sometimes drawn, at about two inches distant, and
sometimes not, which makes the arms look as big as Miss Taylor’s
body. I like none of this but the flouncing, which is very pretty, and I
shall bring three or four yards of striped muslin to flounce my gowns
and yours. Tell Mrs. Haw, with my love, to prepare for plenty of
hemming and whipping, and not to steal my needles.... I have been
to see Haydon’s picture, and I am enchanted.... I saw, too, in a print-
shop, the beautiful print of ‘Napoleon le Grand,’ of which you know
there were but three in England, and those not to be sold. Oh, that
any good Christian would give me that picture!”
Napoleon Bonaparte was one of her heroes, and she could never
bring herself to adopt the general view of him held by the populace in
this country. Her friend M. St. Quintin wanted her to translate some
epigrams which he had composed against the late Emperor: “Let Mr.
St. Quintin know that he has brought his pigs to the wrong market,”
was her reply to her father, who had offered her the commission. “I
am none of those who kick the dead lion. Let him take them to Lord
Byron, or the editor of The Times, or the Poet Laureate, or the
bellman, or any other official character.... I hate all these insults to a
fallen foe.”
Later, when the Bellerophon with Napoleon on board—then on his
way to exile—put into Plymouth, Miss Mitford wrote to Sir William
Elford: “Goodness! if I were in your place, I would see him! I would
storm the Bellerophon rather than not get a sight of him, ay, and a
talk with him too. You and I have agreed to differ respecting the
Emperor, and so we do now in our thoughts and our reasonings,
though not, I believe, much in our feelings; for your relenting is pretty
much the same as my—(what shall I venture to call it?)—my
partiality.... But though I cannot tell you exactly what I would do with
the great Napoleon, I can and will tell you what I would not do to him.
I would not un-Emperor him—I would not separate him from his
faithful followers—I would not ransack his baggage, as one would do
by a thief suspected of carrying off stolen goods—I would not limit
him to allowances of pocket-money to buy cakes and fruit like a
great schoolboy—I would not send him to ‘a rock in the middle of the
sea,’ like St. Helena.”
But this is a digression. We left Miss Mitford in London describing
the Hans Place celebrations. The next morning she was taken to the
Freemasons’ Tavern, in Great Queen Street, to attend the meeting of
the Friends against the Slave Trade, where she heard such notables
as Lords Grey and Holland, together with William Wilberforce and
Lord Brougham.
“Lord Grey had all the Ogle hesitation, and my noble patron”
[Holland, to whom her first book was dedicated] “has my habit of
hackering so completely that he scarcely speaks three words without
two stops; but when we can get at his meaning, it is better than any
one’s. My expectations were most disappointed in Brougham, and
most surpassed in Wilberforce. I no longer wonder at the influence
he holds over so large a portion of the ‘religionists,’ as he calls them;
he is a most interesting and persuasive speaker.”
The great day, however, was Friday, June 24, 1814, when the
members of the British and Foreign School Society dined together, at
the Freemasons’ Tavern, on the occasion of their anniversary
meeting. The Marquis of Lansdowne was in the chair, supported by
the Dukes of Kent and Sussex, the Earls of Darnley and Eardley,
and several other eminent persons. Miss Mitford and a party of
friends were in the gallery “to hear splendid speeches and
superlative poetry, and to see—but, alas! not to share—super-
excellent eating.” Miss Mitford was always a great believer in, and
supporter of all efforts which were made to facilitate the education of
the people, and on this occasion her ode on The March of Mind,
which she had specially composed for this event, was set to music
and sung. “I did not believe my own ears when Lord Lansdowne,
with his usual graceful eloquence, gave my health. I did not even
believe it, when my old friend, the Duke of Kent, observing that Lord
Lansdowne’s voice was not always strong enough to penetrate the
depths of that immense assembly, reiterated it with stentorian lungs.
Still less did I believe my ears when it was drunk with ‘three times
three,’ a flourish of drums and trumpets from the Duke of Kent’s
band, and the unanimous thundering and continued plaudits of five
hundred people.... Everybody tells me such a compliment to a young
untitled woman is absolutely unprecedented; and I am congratulated
and be-praised by every soul who sees me.”
This London visit, in Miss Mitford’s twenty-seventh year, was an
excellent piece of stage-management, and if it was due to the
exertions of her father—and we may properly suppose it was—it
stands as one achievement, at least, to his credit.
Home from these festivities, with the plaudits of the crowd and the
congratulations of her friends still ringing in her ears, she had once
again to face the problem of depleted coffers and how to set about
the task of filling them. Each succeeding year there was trouble
about the payment of taxes. “I do hope, my own dear love,” runs one
of the letters, “that you returned to London yesterday, and that you
have been actively employed to-day in getting money for the taxes. If
not, you must set about it immediately, or the things will certainly be
sold Monday or Tuesday. There is nothing but resolution and activity
can make amends for the time that has been wasted at Bocking.”
This last sentence alludes to the Doctor’s absence in
Northumberland attending to the complicated money matters of a
relative. Just previous to this Mrs. Mitford had written: “After sending
off our letter to you, yesterday, Farmer Smith came to tell me what a
piece of work the parish made with him about our unpaid rates. They
have badgered him most unmercifully about sending a summons
and compelling payment, but he is most unwilling to take any step
that might be productive of uneasiness to you.... You will be
astonished to hear that there is none of the farmers more
outrageously violent than Mr. Taylor, who blusters and swears he will
not pay his rates if they do not exact the immediate payment of
yours.” The rates due at this time were for two years—£46 8s. in all,
for which the Doctor had paid £10 on account.
Later on there is a promise of other, though similar trouble, in a
letter to the Doctor addressed in great haste to him, and to three
different localities, as they were not sure of his whereabouts. “I am
sorry to tell you, my dearest father, that Mr. Riley’s clerk has just
been here with a law-paper, utterly incomprehensible; but of which
the intention is to inform you that, if the mortgage and interest be not
paid before next Monday, a foreclosure and ejectment will
immediately take place; indeed I am not sure whether this paper of
jargon is not a sort of ejectment. We should have sent it to you but
for the unfortunate circumstance of not knowing where you are. The
clerk says you ought to write to Mr. Riley, and negotiate with him,
and that if the interest had been paid, no trouble would have been
given. Whether the interest will satisfy them now I cannot tell. No
time must be lost in doing something, as next Monday some one will
be put into possession.”
What a sorry plight the mother and daughter must have been in!
No wonder that we read the daughter’s request for “a bottle of
Russia Oil, to cure my grey locks.” And to make matters worse, there
was pending a Chancery Suit in connection with the sale of Bertram
House, which so soured the Doctor that he would have nothing done
to the garden or grounds. The gravel was covered with moss, the turf
lengthened into pasture, and the shrubberies into tangled thickets—a
picture of desolation which only emphasized the misery of the
financial outlook.

FOOTNOTES:
[17] Miss Mitford was wrong in this; Moore went to a cottage near
Ashbourne, in Derbyshire.
CHAPTER XII

DWINDLING FORTUNES AND A GLEAM OF


SUCCESS

Miss Mitford’s great and growing affection for the simple delights of
the country is amply proved in some of the letters which she wrote to
Sir William Elford during the years 1812-1815, and in the publication
of her poems on Watlington Hill and Weston Grove. Of these two
works Watlington Hill is, on the whole, in praise of coursing, although
it also contains some fine descriptions of scenery which all who
know the locality will recognize and appreciate. The piece was
originally published as a separate poem and dedicated to “James
Webb, Esq., and William Hayward, Esq.,” two coursing friends of her
father’s, the last-named being the owner of the Watlington Farm
which Dr. Mitford made his headquarters whenever a coursing
meeting was in progress in the district. In this form it was published
by A. J. Valpy, but later on was embodied in a volume entitled
Dramatic Scenes, and published in 1827, by George B. Whittaker.
Weston Grove is a description of the place of that name, near
Southampton Water, then the seat of William Chamberlayne, Esq.,
M.P.—another friend of the Mitfords—to whom the poem was
inscribed. Neither of these works had a great sale.
In addition to these Miss Mitford made, in 1813, an attempt to
produce a play entitled The King of Poland, concerning which she
wrote to her father that “it will be in five acts instead of three, and
runs much more risk of being too long than too short. My favourite
character is a little saucy page ... and who is, I think, almost a new
character on the English stage. We have, it is true, pages in
abundance, but then they commonly turn out to be love-lorn damsels
in disguise. Now mine is a bona-fide boy during the whole play.”
Late in the year 1815 we find her telling Sir William Elford that she
has “been teased by booksellers and managers, and infinitely more
by papa, for a novel and a play; but, alas! I have been obliged to
refuse because I can only write in rhyme. My prose—when I take
pains, is stiffer than Kemble’s acting, or an old maid’s person, or
Pope’s letters, or a maypole—when I do not, it is the indescribable
farrago which has at this moment the honour of saluting your eyes.
This is really very provoking, because I once—ages ago—wrote four
or five chapters of a novel, which were tolerably lively and
entertaining, and would have passed very well in the herd, had they
not been so dreadfully deficient in polish and elegance. Now it so
happens that of all other qualities this unattainable one of elegance
is that which I most admire and would rather possess than any other
in the whole catalogue of literary merits. I would give a whole pound
of fancy (and fancy weighs light), for one ounce of polish (and polish
weighs heavy). To be tall, pale, thin, to have dark eyes and write
gracefully in prose, is my ambition; and when I am tall, and pale, and
thin, and have dark eyes, then, and not till then, will my prose be
graceful.”
In this outline of qualifications for the writing of graceful prose Miss
Mitford did herself scant justice, as time has proved; for while her
verse is forgotten, it is her prose alone which has lived and by which
she is remembered. Had personal bulk been the deciding factor,
then, assuredly she would have been ruled out, for in a previous
letter to Sir William—with whom, by the way, she was now on such
intimate terms that personal matters of this sort were freely
discussed—she had informed him of the “deplorable increase of my
beautiful person. Papa talks of taking down the doors, and widening
the chairs, and new hanging the five-barred gates, and plagues me
so, that any one but myself would get thin with fretting. But I can’t
fret; I only laugh, and that makes it worse. I beg you will get a recipe
for diminishing people, and I will follow it; provided always it be not to
get up early, or to ride on horseback, or to dance all night, or to drink
vinegar, or to cry, or to be ‘lady-like and melancholy,’ or not to eat, or
laugh, or sit, or do what I like; because all these prescriptions have
already been delivered by divers old women of both sexes, and
constantly rejected by their contumacious patient.” And this she
supplemented by likening herself to “a dumpling of a person tumbling
about like a cricket ball on uneven ground, or a bowl rolling among
nine-pins.”
Of her prose, we shall find that her earliest descriptive pieces were
contained in the letters sent to Sir William and, although they may
lack the grace of the later finished work written for publication, they
do, at least, prove their author’s possession of “the seeing eye.”
“I am just returned from one of those field rambles which in the
first balmy days of spring are so enchanting. And yet the meadows,
in which I have been walking, are nothing less than picturesque. To a
painter they would offer no attraction—to a poet they would want
none. Read and judge for yourself in both capacities. It is a meadow,
or rather a long string of meadows, irregularly divided by a shallow,
winding stream, swollen by the late rains to unusual beauty, and
bounded on the one side by a ragged copse, of which the outline is
perpetually broken by sheep walks and more beaten paths, which
here and there admit a glimpse of low white cottages, and on the
other by tall hedgerows, abounding in timber, and strewn like a
carpet with white violets, primroses, and oxlips. Except that
occasionally over the simple gates you catch a view of the soft and
woody valleys, the village churches and the fine seats which
distinguish this part of Berkshire, excepting this short and unfrequent
peep at the world, you seem quite shut into these smiling meads.
“Oh, how beautiful they were to-day, with all their train of callow
goslings and frisking lambs, and laughing children chasing the
butterflies that floated like animated flowers in the air, or hunting for
birds’ nests among the golden-blossomed furze! How full of
fragrance and of melody! It is when walking in such scenes, listening
to the mingled notes of a thousand birds, and inhaling the mingled
perfume of a thousand flowers, that I feel the real joy of existence. To
live; to share with the birds and the insects the delights of this
beautiful world; to have the mere consciousness of being, is
happiness.”
That was her picture of Spring. She improved as the year rolled
on, and the next January gave play for her pen in a description of
hoar-frost.
“A world formed of something much whiter than ivory—as white,
indeed, as snow—but carved with a delicacy, a lightness, a precision
to which the massy, ungraceful, tottering snow could never pretend.
Rime was the architect; every tree, every shrub, every blade of grass
was clothed with its pure incrustations; but so thinly, so delicately
clothed, that every twig, every fibre, every ramification remained
perfect; alike indeed in colour, but displaying in form to the fullest
extent the endless, infinite variety of nature. This diversity of form
never appeared so striking as when all the difference of colour was
at an end—never so lovely as when breaking with its soft yet well-
defined outline on a sky rather grey than blue. It was a scene which
really defies description.”
It was during this period, notably in 1812, that Miss Mitford must,
metaphorically speaking, have begun “to feel her feet” in literary
matters. The adulation of her father’s friends in London, backed up
by the reviews, which were, generally, favourable to her work, were
sufficient proof that she had a public and that, in time, she might
hope to secure something like a regular and even handsome income
from her pen. In this she was encouraged by Sir William Elford, who
did all that was possible to impress upon her the necessity for
studied and polished work. To this end he informed her that he was
carefully saving her letters, playfully hinting that they might prove
valuable some day. This may account for the “high, cold, polish”
which William Harness deprecated. The hint was not lost on her and
drew from her an amusing and, as events have proved, prophetic
reply: “I am highly flattered, my dear Sir William, to find that you think
my letters worth preserving. I keep yours as choice as the monks
were wont to keep the relics of their saints; and about sixty years
hence your grandson or great grandson will discover in the family
archives some notice of such a collection, and will send to the
grandson of my dear cousin Mary (for as I intend to die an old maid, I
shall make her heiress to all my property, i.e. my MSS.) for these
inestimable remains of his venerable ancestor. And then, you know,
my letters will be rummaged out, and the whole correspondence be
sorted and transcribed, and sent to the press, adorned with portraits,
and facsimiles, and illustrated by lives of the authors, beginning with
the register of their birth, and ending with their epitaphs. Then it will
come forth into the world, and set all the men a-crowing and talking
over their old nonsense (with more show of reason, however, than
ordinary) about the superiority of the sex. What a fine job the
transcriber of my letters will have! I hope the booksellers of those
days will be liberal and allow the poor man a good price for his
trouble; no one but an unraveller of state cyphers can possibly
accomplish it,”—this in allusion to the occasional illegibility of her
handwriting which elsewhere she described as “hieroglyphics, which
the most expert expounders of manuscripts fail to decipher.”
Reference to her manuscripts recalls the trouble some of them
entailed on young Valpy, the printer—really a long-suffering and
estimable young man—and his staff. For a writer so fully aware of
her shortcomings in this matter, as was Miss Mitford, she was
extraordinarily impatient and exacting. Poor Valpy did his best
according to his lights—and these were not inconsiderable—and
was more than usually anxious in the setting-up of Miss Mitford’s
work, seeing that, as she remarked in one of her letters, he had
“dandled me as an infant, romped with me as a child, and danced
with me as a young woman,” but by reason of which, she unkindly
concluded, he “finds it quite impossible to treat me or my works with
the respect due to authorship.”
Judging by the hundreds of Miss Mitford’s letters which we have
handled, full of closely-written and often indecipherable characters,
we are of opinion that she was singularly fortunate in finding a printer
able and willing to ascertain their meaning. Her condolences with her
friend, Sir William, on his “press-correcting miseries” are, though
extravagant, very diverting and, in these days of trade-unionism,
throw an interesting light on the personnel of Valpy’s little
establishment in Tooke’s Court. “I am well entitled to condole with
you, for I have often suffered the same calamity. It is true that my
little fop of a learned printer has in his employ three regularly-bred
Oxonians, who, rather than starve as curates, condescend to
marshal commas and colons, and the little magical signs which
make the twenty-four letters, as compositors; and it is likewise true,
that the aforesaid little fop sayeth—nay, I am not sure that he doth
not swear—that he always gives my works to his best hands. Now,
as it is not mannerly for a lady to say ‘you fib,’ I never contradict this
assertion, but content myself with affirming that it is morally
impossible that the aforesaid hands can have that connection with a
head which is commonly found to subsist between those useful
members. Some great man or other—Erasmus, I believe—says that
‘Composing is Heaven, preparing for publication Purgatory, and
correcting for the press’—what, must not be mentioned to ‘ears
polite.’ And truly, in my mind, the man was right. From these
disasters I have, however, gained something:—‘Sweet are the uses
of adversity’; and my misfortunes have supplied me with an
inexhaustible fund of small charity towards my unfortunate brethren,
the mal-printed authors. For, whereas I used to be a most desperate
and formidable critic on plural or singular, definite and indefinite,
commas and capitals, interrogations and apostrophes, I have now
learnt to lay all blunders to the score of the compositor, and even
carry my Christian benevolence so far that, if I meet with divers
pages of stark, staring nonsense (and really one does meet with
such sometimes), instead of crying, ‘What a fool this man must be—
I’ll read no more of his writing!’ I only say, ‘How unlucky this man has
been in a compositor! I can’t possibly read him until he changes his
printer.’” Nevertheless, and although there might be an occasional
author glad to shelter himself behind such an excuse, the fact
remains that the work which emanated from Valpy’s press is entitled
to the highest encomiums—despite his three Oxonians who,
choosing the better part, preferred to compose type rather than
sermons.
There is no record that Miss Mitford published anything from the
year 1812—when Watlington Hill appeared—until 1819, the interval
being occupied with various short trips to London, most of which
were, however, only undertaken at the urgent request of friends who
were keen on offering hospitality and entertainment. But for this
hospitality and the assurance that the visits would entail little or no
expense, it is evident that they could not have been indulged in. The
Chancery suit still dragged its weary length along and the Doctor
continued his lengthy jaunts to town, each trip being followed by the
infliction of fresh privation on his wife and daughter. The large retinue
of servants which had been installed when the family took
possession of Bertram House, had dwindled gradually, until at last it
was represented by one, or, at most, two. There was no lady’s maid,
and the footman had been replaced by a village lad who, when not
waiting at table, had to make himself useful in the garden or stable—
the jobs he was really only fitted for. The carriage-horses had gone
and were replaced by animals which could be commandeered for
farm-work; the result being that, as they were oftenest on the farm,
they were rarely available for use in the carriage, thus curtailing the
pleasure of the ladies, both of whom greatly enjoyed this form of
exercise. Finally, when the carriage required to be repaired and
painted, it was found that there was no money in hand, so it was sold
and never replaced.
Mrs. Mitford had the greatest difficulty in getting sufficient
housekeeping money wherewith to meet their quite modest
expenses, until at last the tradesmen refused to supply goods unless
previous accounts were settled and ready money paid for the goods
then ordered. They were really in the most desperate straits for
money—the daughter actually contemplated the opening of a shop—
and in one letter we are told that Mrs. Mitford begged her husband to
send her a one-pound note, as they were in need of bread! This
represented actual want, and yet, through it all, there was scarcely
any diminution in the kennel, the occupants of which were a source
of the greatest anxiety to Mrs. Mitford, who frequently did not know
whither to turn in order to obtain food for them.
In perusing the letters which were written to the various friends of
the family during this period, it is astonishing to find little or no
evidence of the distress under which the writer suffered. Miss
Mitford’s optimism was remarkable, whilst her belief in her father was
so strong that even when she found that their miserable condition
was due to his losses at the gaming-tables, she only commiserated
him and blamed others for cheating and wronging so admirable a
man, an attitude of mind which her mother shared!
It was towards the end of the year 1818 that she seriously thought
of turning her attention to prose, encouraged by Sir William Elford,
who had been struck by her descriptions of the neighbourhood in
which she lived. She conceived the idea of writing short sketches
illustrative of country scenes and manners, and when she had
executed a few of these to her own and mamma’s satisfaction, they
were submitted to Thomas Campbell as possible contributions to the
New Monthly Magazine, of which he was then the Editor. He would
have nothing to do with them, nor did he encourage the writer to try
them elsewhere. Nothing daunted, she offered them to one or two
other Editors, but still met with refusal until she tried the Lady’s
Magazine, the editor of which had the good sense not only to accept
them but asked for more. The result to the magazine was that its
circulation went up by leaps and bounds, and the name of Mary
Russell Mitford, hitherto known only to a limited circle, became
almost a household word.
CHAPTER XIII

LITERARY FRIENDS AND LAST DAYS AT


BERTRAM HOUSE

“What have you been doing, my dear friend, this beautiful autumn?”
wrote Miss Mitford to Sir William Elford, towards the end of 1817.
“Farming? Shooting? Painting? I have been hearing and seeing a
good deal of pictures lately, for we have had down at Reading Mr.
Hofland, an artist whom I admire very much (am I right?), and his
wife, whom, as a woman and an authoress, I equally love and
admire. It was that notable fool, His Grace of Marlborough, who
imported these delightful people into our Bœotian town. He—the
possessor of Blenheim—is employing Mr. Hofland to take views at
Whiteknights—where there are no views; and Mrs. Hofland to write a
description of Whiteknights—where there is nothing to describe.[18] I
have been a great deal with them and have helped Mrs. Hofland to
one page of her imperial quarto volume; and to make amends for
flattering the scenery in verse, I comfort myself by abusing it in prose
to whoever will listen.” The Hoflands were an interesting couple, and
Mrs. Hofland, in particular, became one of Miss Mitford’s dearest
friends and most regular correspondents. She was already an author
of some repute and an extremely prolific writer. In the year 1812 she
wrote and published some five works, including The Son of a
Genius, which had a considerable vogue. Previous to her marriage
with Hofland she had been married to a Mr. Hoole, a merchant of
Sheffield, who died two years after their marriage, leaving her with
an infant four months old and a goodly provision in funds invested.
Owing to the failure of the firm which was handling her money, she
was left on the verge of poverty and had a bitter struggle to secure
enough to live upon. A volume of poems which she published in
1805 brought her a little capital, with which she was enabled to open
a boarding-school at Harrogate; but in this venture she failed, and
then took to writing for a living. In 1808 she married Mr. Hofland, an
event which crowned her troubles for, although outwardly there was
no sign of it, there is every certainty that the overbearing selfishness
of Hofland and his lack of consideration for any but himself, made
their home-life almost unendurable. It will, therefore, be understood
why so much sympathy came to exist between Miss Mitford and her
friend, seeing that they were both suffering from an almost similar
trouble, although the matter was seldom mentioned between them.
Mrs. Hofland was an extremely pious woman, and she was also
something of a busybody, though possibly one whose interest in the
affairs of others was never unpleasant enough to cause trouble.
Hearing of the Elford correspondence, she twitted Miss Mitford with
having matrimonial designs in that quarter, which drew from the latter
the clever retort: “The man is too wise; he has an outrageous fancy
for my letters (no great proof of wisdom that, you’ll say), and
marrying a favourite correspondent would be something like killing
the goose with the golden eggs.”
Another of the notables who came prominently into Miss Mitford’s
life at this period was young Thomas Noon Talfourd, the son of a
Reading brewer. He had been educated at the Reading Grammar
School under Dr. Valpy, and “began to display his genius by
publishing a volume of most stupid poems before he was sixteen.”
The description is, of course, Miss Mitford’s. Nevertheless, he who
wrote such detestable poetry, “wrote and talked the most exquisite
prose.” Upon leaving school he was sent “to Mr. Chitty a-special-
pleading; and now he has left Mr. Chitty and is special pleading for
himself—working under the Bar, as the lawyers call it, for a year or
two, when he will be called; and I hope, for the credit of my
judgment, shine forth like the sun from behind a cloud. You should
know that he has the very great advantage of having nothing to
depend on but his own talents and industry; and those talents are, I
assure you, of the very highest order. I know nothing so eloquent as
his conversation, so powerful, so full; passing with equal ease from
the plainest detail to the loftiest and most sustained flights of
imagination; heaping with unrivalled fluency of words and of ideas,
image upon image and illustration upon illustration. Never was
conversation so dazzling, so glittering. Listening to Mr. Talfourd is
like looking at the sun; it makes one’s mind ache with excessive
brilliancy.”
Miss Mitford’s prophecy as to Talfourd’s future was more than
fulfilled, and he came, at length, not only to illumine the legal
profession but to shed a considerable lustre on literature and the
drama.
A year or two after the writing of the eulogy just quoted, Talfourd
was in Reading in a professional capacity and caused a mild
sensation by his masterly and eloquent pleading. Miss Mitford went,
with her father, to hear him, and was so moved that she wrote the
following sonnet:—
“On Hearing Mr. Talfourd Plead in the Assize-Hall at
Reading, on his first Circuit,
March, 1821.

Wherefore the stir? ’Tis but a common cause


Of cottage plunder: yet in every eye
Sits expectation;—murmuring whispers fly
Along the crowded court;—and then a pause;—
And then a clear, crisp voice invokes the laws,
With such a full and rapid mastery
Of sound and sense, such nice propriety,
Such pure and perfect taste, that scarce the applause
Can be to low triumphant words chained down
Or more triumphant smiles. Yes, this is he,
The young and eloquent spirit, whose renown
Makes proud his birth place! a high destiny
Is his; to climb to honour’s palmy crown
By the strait path of truth and honesty.”
During the year 1817, Sir William Elford lost his wife. She was a
most estimable woman, and although her husband had,
occasionally, called on the Mitfords—turning aside, for that purpose,
from the main road which ran through Reading—in his journeys from
the west to London, she had never made their acquaintance and
only knew of them by repute and what she gathered from the
voluminous correspondence which passed between her husband
and his literary friend. News of this lady’s death drew from Miss
Mitford a charming letter of condolence which must have proved to
Sir William how large a place he held in her thoughts: “Your very
touching letter, my dear friend, brought me the first intelligence of the
dreadful loss you have experienced. I had not even any idea of
danger, or surely, most surely, I should never have intruded on you
those letters whose apparently heartless levity I am now shocked to
remember. I write now, partly in pursuance of your own excellent
system, to avoid, as much as may be, prolonging and renewing your
sorrow, and partly to assure you of our sincere and unaffected
sympathy. We had not, indeed, the happiness of a personal
acquaintance with Lady Elford, but the virtues of the departed are
best known in the grief of the survivors. To be so lamented is to have
been most excellent. And the recollected virtue, which is now agony,
will soon be consolation. God bless and comfort you all!
“I hope soon to hear a better account both of yourself and your
daughters; but do not think of writing out of form or etiquette. Write
when you will, and what you will, certain that few, very few, can be
more interested in your health or happiness than your poor little
friend.”
From this date the correspondence between the two underwent a
considerable change in tone and feeling. It became less stilted,
suggesting to the unbiassed reader the idea that the existence of
Lady Elford had, hitherto, forced the young person at Bertram House
to mind her P’s and Q’s, “which I detest having to do.” She may,
possibly, have adopted this freer style of writing in the hope of
diverting Sir William from thinking of his bereavement. In any case
the happier style of writing thus begun was never abandoned, and
the consequence was that, thereafter, they contained more of that
life and spirit which her friend Harness thought so characteristic of
her writings when she let her words drop without any premeditation,
at the prompting of her emotions.
“I have lately heard a curious anecdote of Mr. Coleridge,” she
writes, “which, at the risk—at the certainty—of spoiling it in the
telling, I cannot forbear sending you. He had for some time
relinquished his English mode of intoxication by brandy and water for
the Turkish fashion of intoxication by opium; but at length the earnest
remonstrance of his friends, aided by his own sense of right,
prevailed on him to attempt to conquer this destructive habit. He put
himself under watch and ward; went to lodge at an apothecary’s at
Highgate, whom he cautioned to lock up his opiates; gave his money
to a friend to keep; and desired his druggist not to trust him. For
some days all went on well. Our poet was ready to hang himself;
could not write, could not eat, could not—incredible as it may seem
—could not talk. The stimulus was wanting, and the apothecary
contented. Suddenly, however, he began to mend; he wrote, he
read, he talked, he harangued; Coleridge was himself again! And the
apothecary began to watch within doors and without. The next day
the culprit was detected; for the next day came a second supply of
laudanum from Murray’s, well wrapped up in proof sheets of the
Quarterly Review.”
As a foil to this she tells, in the next letter, a story of Haydon the
painter—poor, embittered disappointed Haydon, who, later, killed
himself—which she had just heard from Mrs. Hofland. “He was
engaged to spend the day at Hampstead, one Sunday, with some of
the cleverest unbelievers of the age ... and being reproached with
coming so late, said with his usual simplicity, ‘I could not come
sooner—I have been to church.’ You may imagine the torrent of
ridicule that was raised upon him. When it had subsided, ‘I’ll tell ye
what, gentlemen,’ said he, ‘I knew when I came amongst ye—and
knowing this it is not, perhaps, much to my credit that I came—that I
was the only Christian of the party; but I think you know that I will not
bear insult, and I now tell you all that I shall look upon it as a
personal affront if ever this subject be mentioned by you in my
hearing; and now to literature, or what you will!’”
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookfinal.com

You might also like