ebook img

Unity Apprentice PDF

274 Pages·2022·38.751 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Unity Apprentice

Unity Apprentice i What You Need To follow along with this book, you’ll need the following: The Unity Hub: The latest version will work. At the time of writing, this was version 3.0.0. The Unity Editor: Choose to install the latest 2020.3.x LTS Release. All the sample projects will work with this version. Any Code Editor or IDE: Ideally, this should be able to understand and format C#. Since C# was originally written by Microsoft, a good choice would be Visual Studio Community (if you’re using Windows) or Visual Studio Code (if you’re using macOS or Linux). But, you can use whatever editor you’re most comfortable with if you prefer! 2 Unity Apprentice ii Book Source Code & Forums Where to download the materials for this book The materials for this book can be cloned or downloaded from the GitHub book materials repository: https://github.com/raywenderlich/uapp-materials/tree/editions/1.0 Forums We’ve also set up an official forum for the book at https://forums.raywenderlich.com/c/books/unity-apprentice. This is a great place to ask questions about the book or to submit any errors you may find. 3 Unity Apprentice iii Dedications “To Bonnie, Merlijn and Harvey. Thanks for all the support and the laughs. This wouldn’t be possible without you.” — Eric Van de Kerckhove “To my two sons, Felix and Leif, and all the games we will play together.” — Matt Larson “In memory of Ian Quin, who taught me better English long before I would ever write a page worth reading. You will be missed, Grampa.” — Ben MacKinnon 4 Unity Apprentice iv About the Team About the Authors Eric Van de Kerckhove is a hobbyist game developer and 3D printing enthusiast from Belgium. Most days, you can find him at his desk while tinkering on scripts to automate tasks and creating 3D models to use in games or to print. Matt Larson is a software developer for the life sciences and scientific visualization. He was an author on Unity AR & VR by Tutorials and is a believer in new technologies for engaging with 3D content. When he is not working on software, you’ll find him fixing up old synthesizers, kayaking and spending time with his wife and kids. Ben MacKinnon has been a Unity Developer for as long as he has been a father, with both playing a huge part in his life. He spent a large part of his career Augmenting Architecture, but more recently has focussed on VR in development of the virtual communications platform ENGAGE. About the Editors Toby Flint is a tech editor of this book. Toby is a software developer inspired by a love of games. When he’s not programming or otherwise staring at a screen, you can find him exploring the backcountry, tasting a new crispy beverage, poking at a piano, or staring at a wall, absent-mindedly absorbed in his own thoughts. 5 Unity Apprentice About the Team Srikar Mutnuri is a tech editor of this book. Srikar is a software developer who loves building things. When the git commits are done, you can mostly find him reading a book, practicing music, or simply bingeing that new series. Megan Mallicoat is the editor of this book. She’s a university journalism instructor and has professional experience in communications management, web design and graphic design — but she’s most devoted to pointing out grammar and spelling errors. In her “free time,” you’ll most likely find her on the sidelines of some kind of kids sports practice, holding a book. Adrian Strahan is the final pass editor for this book. Adrian is a lead iOS developer working for a leading UK bank. When he’s not sat in front of a computer building apps or playing games, he enjoys long walks, streaming movies, building Lego models, listening to music and trying to keep fit and healthy. About the Artists Jake Nolt is a 3D artist, indie game developer and game development professor. When not developing or teaching, Jake enjoys spending time with family, gaming and being outdoors. 6 Unity Apprentice 1 Getting Started Written by Eric Van de Kerckhove Welcome to the start of your game development journey with the help of Unity Apprentice! By opening this book, you’re already on your way to becoming a game developer. The four sections within these pages will teach you how to create games using the Unity game engine. From navigating the editor and adding objects to a scene to creating complex animations and using advanced scripting, it’s all in here for you to discover. This book assumes you have no experience with Unity or the programming language C#. That means if you’re completely new to Unity, you’ll feel right at home. Even if you’re a veteran, this book is full of useful tips and techniques the authors have learned over the years. What is Unity? Unity is a cross-platform game engine, which is a software framework designed for creating video games with a lot of tools geared toward making the process easier and more comfortable. It’s developed by Unity Technologies and has been regularly updated since its introduction in 2005. There’s a good chance you’ve played at least one game developed using Unity — some of the more popular titles include Among Us, Cities: Skylines, Hearthstone, Hollow Knight and Cuphead. Why use Unity? Unity is the most popular game engine to date and loved by beginners and experts alike for a lot of reasons. Here are some reasons why Unity is great: Unity is free to use for hobbyists and small game studios. Unity’s editor runs on Windows, macOS and Linux — making it a true cross- platform tool. The Unity editor is easy to use and navigate, and the way you manipulate objects in a scene is intuitive. Unity uses the “create once, deploy anywhere” principle. This means you can create a game and distribute it to all standalone platforms, mobile devices, consoles and the web without needing to maintain multiple projects or code bases. 7 Unity Apprentice Chapter 1: Getting Started The scripting language driving Unity games is C#, which is one of the most- used programming languages around the globe. This makes it easy to learn the language because the web is full of articles and tutorials on the subject. There’s a helpful community spread across the forums, Unity Answers and its Discord server that are friendly toward beginners. Most parts of Unity are well-documented with clear explanations and examples. If you’re still not convinced, check out some of the stories by game studios that use Unity for their development. Some of these stories offer unique behind-the- scenes perspectives that are worth a read. Requirements and expectations Getting into making games nowadays is easier than ever! All you need to follow along with this book is a computer, an internet connection and some time. Unity and the tools used throughout the book — like Visual Studio (Code) — are free. This book covers some mechanics and ideas used in popular indie games like Night In The Woods and Overcooked. The resulting games provide basic gameplay and artwork to complete a concept and get important ideas across. They aren’t full-featured games like you would buy from Steam or the Epic Games Store. Each of the final projects provides a great starting point to learn from and build upon to create something truly unique yourself. What’s ahead This book is divided into four sections: Section 1 covers why and how you should use Unity. The goal of this section is to give you a broad overview of the Unity editor. You’ll build a sample project to learn all about GameObjects, Prefabs and even some C# scripting. Section 2 goes over Unity’s essential features. This includes setting up a scene and its lighting, handling input and user interfaces. At the end of it, you’ll have a charming game with an easily extendable conversation system. Section 3 is all about pathfinding and AI. This section will teach you how to make AI-controlled characters find their way around an arena and use advanced camera techniques. This section concludes with a fun shooting game to use as a base. 8 Unity Apprentice Chapter 1: Getting Started Section 4 shows you the ropes when it comes to animations. From lerps to tweens, this section teaches you how to make your games more dynamic and lively by using Unity’s scripting API and animation system. As a cherry on top, it shows you how to use scriptable objects in interesting ways. At the end you’ll have a cooking game that’s ready for you to expand upon. By the end of this book, you’ll be able to create your own games and make them run on Windows, macOS and Linux! Key points You don’t need any experience with Unity or C# to follow along with this book. Unity is a free cross-platform game engine. The documentation for Unity and its scripting API can be found online. With Unity, you can create games for a lot of different platforms — including Windows, macOS, iOS, Android and even the web. Scripting is done with C#, a popular programming language. The projects in this book are starting points to create your own games. Where to go from here? It’s easy to get overwhelmed by the amount of windows, components and settings Unity provides. If you’re unsure what something does or how to use it, you can take a look at Unity’s manual. And, you can take a peek at the scripting reference when you want more information about a certain class or method while scripting. In case you can’t find what you’re looking for in the sources above, there’s the forums and Unity Answers, both of which contain a treasure trove of information and give you a place to ask your own questions. There’s also Unity’s Discord server, where you can share your creations and ask for feedback and help. Finally, there’s the raywenderlich.com website, which is full of articles about game development for Unity and tools to help you on your journey. 9 Unity Apprentice 2Installing & Using the Unity Editor Written by Matt Larson Introduction It’s time to develop your first Unity game! The Unity Hub is your gateway to install the Unity Editor, manage all your projects and find tutorial resources. Be aware there are different versions of the Unity Editor as updates and improvements are continually released. However, the Unity Hub will help you install and manage editor versions. It acts as a single overall manager for downloading the latest Unity Editors, keeping track of your projects and launching the Unity Editor. Installing the Unity Hub Start by downloading the Unity Hub installer for either Windows or Mac from https://unity.com/download: You should install the latest version of the Unity Hub (3.0.0 at the time of writing) to have an up-to-date listing of sample starter content. After installation, start the Unity Hub and you’ll see this: 10

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.