Building an RPG with
Unity 2018
Second Edition
Leverage the power of Unity 2018 to build elements of
an RPG.
Vah Karamian
BIRMINGHAM - MUMBAI
Building an RPG with Unity 2018Second Edition
Copyright 2018 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Commissioning Editor: Kunal Chaudhari
Acquisition Editor: Noyonika Das
Content Development Editor: Francis Carneiro
Technical Editor: Ralph Rosario
Copy Editor: Safis Editing
Project Coordinator: Devanshi Doshi
Proofreader: Safis Editing
Indexer: Mariammal Chettiyar
Graphics: Jason Monteiro
Production Coordinator: Aparna Bhagat
First published: March 2016
Second edition: July 2018
Production reference: 1270718
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78862-346-9
www.packtpub.com
To my wife Armineh for being my loving partner throughout our joint life-journey.
To my son and daughter, Maximilian and Makayla.Vah Karamian
mapt.io
Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Why subscribe?
Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
Get a free eBook or video every month
Mapt is fully searchable
Copy and paste, print, and bookmark content
PacktPub.com
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at service@packtpub.com for more details.
At www.PacktPub.com , you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Contributors
About the author
Vah Karamian is a software consultant and author based in Los Angeles, CA. He is the founder of Noorcon Inc., a software consulting firm in Burbank, CA, providing services in the field of augmented reality and virtual reality used in the entertainment, architecture, medical, and manufacturing industries. He has lectured in state and private universities on topics including Introduction to Computer Science, Data Structures and Algorithms, Operating Systems, and Game Design and Development.
I would like to acknowledge my wife, Armineh, and our two beautiful children, Maximilian and Makayla, for their support through the long nights in the preparation of this book. Thank you and love you.
About the reviewers
Adam Larson started programming professionally in 2005. He has shipped 14 console games, 2 PC titles, and 8 mobile games. In 2012, he founded a company that focused on using Unity for business applications. He spent the following 5 years building a million dollar agency that built high-end software. Recently, he moved to another start-up that focuses on revolutionizing the banking industry. When he isn't doing something with technology, you will find him spending time with his wife and three kids.
Francesco Sapio has a master's of science in engineering in AI and Robotics, scoring summa cum laude. Now, he is a PhD researcher. He is a Unity and Unreal expert. Among his many projects, he developed Gea2 (Sapienza), Sticker Book (Dataware Games), and consulted for Prosperity Italy 1434, Mi Rasna (Entertainment Game Apps, Inc), and Projekt I.D (RMIT). He is an active writer on game development, authoring Getting Started with Unity 5.x 2D Game Development, Unity UI Cookbook, and many others. Finally, Francesco loves math, philosophy, logic, and puzzle solving, but mostly loves creating video games.
I'm deeply thankful to my family for their enthusiasm and support throughout my life; they have always encouraged me to do better with the Latin expressions "Ad maiora" and "Per aspera ad astra". Finally, a huge thanks to all the special people around me whom I love, in particular to my sweetheart; Im grateful for all your help in everything.
Michael Miles is a manufacturing engineer working in the aerospace industry by day and a Unity game designer, C#, JavaScript, and Python developer at all other times. With these skills and upon discovering Unity3D and Blender, Michael began creating interactive training and production-ready instruction tools for the assembly of the aircraft his company builds.
When not in front of a computer screen, he likes to play games with family and friends or immerse himself in books from fantasy to theoretical physics.
Thanks to my parents for always being there, supporting every decision I made, however unwise you thought it was at the time.
Packt is searching for authors like you
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
Table of Contents
Preface
Everyone wants to make a gametoday, this is possible more than ever due to the democratization of the game industry and the tools that are used to design and develop games. This book is written with several purposes in mind. During the process of writing this book, Unity went through several major updates and releases. At the time of writing, Unity stands at version 2018.1.1f1, and the new release has added many great features to the game engine. Simply put, it is impossible to cover everything in one single book!
This book is intended as a reference guide for individuals who want to learn about Unity and apply their skills for the creation of a