Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Hands-On Unity  Game Development - Fourth Edition

You're reading from  Hands-On Unity Game Development - Fourth Edition

Product type Book
Published in Jan 2024
Publisher Packt
ISBN-13 9781835085714
Pages 742 pages
Edition 4th Edition
Languages
Authors (2):
Nicolas Alejandro Borromeo Nicolas Alejandro Borromeo
Profile icon Nicolas Alejandro Borromeo
Juan Gabriel Gomila Salas Juan Gabriel Gomila Salas
Profile icon Juan Gabriel Gomila Salas
View More author details

Table of Contents (28) Chapters

Preface 1. Section 1: Getting Started with Unity
2. Embark on Your Unity Journey 3. Crafting Scenes and Game Elements 4. From Blueprint to Reality: Building with Terrain and ProBuilder 5. Seamless Integration: Importing and Integrating Assets 6. Section 2: Mastering Programming and Gameplay Mechanics
7. Unleashing the Power of C# and Visual Scripting 8. Dynamic Motion: Implementing Movement and Spawning 9. Collisions and Health: Detecting Collisions Accurately 10. Victory or Defeat: Win and Lose Conditions 11. Starting Your AI Journey: Building Intelligent Enemies for Your Game 12. Section 3: Elevating Visuals, Effects, and Audio
13. Material Alchemy: Using URP and Shader Graph for Stunning Visuals 14. Captivating Visual Effects: Harnessing Particle Systems and Visual Effect Graph 15. Enlightening Worlds: Illuminating Scenes with the Universal Render Pipeline 16. Immersive Realism: Achieving Fullscreen Effects with Post-Processing 17. Harmonious Soundscapes: Integrating Audio and Music 18. Section 4: Designing User Interfaces, Animations and Advanced Concepts
19. Interface Brilliance: Designing User-Friendly UI 20. Next-Gen UI: Creating Dynamic Interfaces with UI Toolkit 21. Animated Realities: Creating Animations with Animator, Cinemachine, and Timeline 22. Performance Wizardry: Optimizing Your Game with Profiler Tools 23. From Prototype to Executable: Generating and Debugging Your Game 24. AR/VR 25. Massive Worlds: Introduction to DOTS 26. Other Books You May Enjoy
27. Index

Preface

I can vividly remember the trepidation I felt about telling my parents that I was going to study game development. At that time, in my region, this ambition was dismissed as juvenile and lacking in future prospects. However, my tenacity and determination led me to chase this dream relentlessly. Today, the game industry has grown exponentially, surpassing even the film industry in revenue.

Of course, following my dream was more difficult than I anticipated. Anyone with the same dream as me sooner or later realizes the complexity and depth of knowledge required in this field. Sadly, this steep learning curve leads many to give up, but I strongly believe that with the proper guidance and tools, you can make your career path easier. For me, mastering Unity was pivotal in streamlining my learning process. And this book is a culmination of that experience, aimed at easing your journey into the world of game development.

Welcome to this book about Unity 2023. This book will introduce you to the latest Unity features so that you can create your first video game in the simplest way possible. Unity offers an array of user-friendly yet powerful tools to address common game development challenges, such as rendering, animation, physics, sound, and effects. We will utilize all these features to create a simple but complete game, delving into all the intricacies of Unity.

By the end of this book, you will have all the skills necessary to use Unity effectively, allowing you to explore in depth various areas of game development that interest you, whether for building a professional career or simply for the joy of creating games as a hobby. Unity is a versatile tool for both professional and amateur projects, and it is being used every day by more and more people.

Unity’s utility extends beyond game creation; it’s a powerful platform for all kinds of interactive applications, from straightforward mobile apps to complex educational and training programs, often referred to as Serious Gaming. These applications harness cutting-edge technologies like Augmented and Virtual Reality. Therefore, while our primary focus here is game development, you are embarking on a learning journey that offers a spectrum of potential specializations.

Who this book is for

This book has been thoughtfully structured to cater to people from various backgrounds. If you have a basic understanding of Object-Oriented Programming (OOP) but are new to game development or have never used Unity, you’ll find this book a good introduction to both game development and Unity’s fundamental to advanced concepts. Even seasoned Unity developers looking to master the platform’s latest features will discover valuable insights in many sections of this book.

On the other hand, if you’re starting without any programming experience, this book is still highly accessible. Many chapters have been designed to be informative without requiring prior coding knowledge. These sections will equip you with a solid foundation for starting to learn how to code in Unity, making the learning curve much smoother than it would be otherwise. Once you’ve grasped the basics of coding, the scripting-focused chapters of this book will become increasingly beneficial. Additionally, with the introduction of Visual Scripting in Unity, those who prefer node-based scripting have an appealing alternative available.

What this book covers

Chapter 1, Embark on Your Unity Journey, teaches you how to install and set up Unity on your computer, as well as how to create your first project.

Chapter 2, Crafting Scenes and Game Elements, teaches you the concepts of Scenes and GameObjects, the Unity way to describe what your game world is composed of.

Chapter 3, From Blueprint to Reality: Building with Terrain and ProBuilder, is where we will be creating our first level layout, prototyping it with the Terrain and ProBuilder Unity features.

Chapter 4, Seamless Integration: Importing and Integrating Assets, is where we will be creating our first level layout, prototyping it with the Terrain and ProBuilder Unity features.

Chapter 5, Unleashing the Power of C# and Visual Scripting, is the first programming chapter of the book. We will learn how to create our first script using C# in the Unity way, and then we will explore how to do the same with Visual Scripting, the new node-based coding language of Unity.

Chapter 6, Dynamic Motion: Implementing Movement and Spawning, teaches you how to program the movement of your objects and how to spawn them. This chapter introduces the new Unity Input System. General programming knowledge is assumed from this point on.

Chapter 7, Collisions and Health: Detecting Collisions Accurately, teaches you how to configure the Physics settings of objects to detect when two of them collide and react to the collision, creating a health system, in this case.

Chapter 8, Victory or Defeat: Win and Lose Conditions, covers how to detect when the game should end, both when the player wins and loses.

Chapter 9, Starting your AI Journey: Building Intelligent Enemies for Your Game, covers creating a basic AI using several Unity features for creating challenging enemies in our game.

Chapter 10, Material Alchemy: Using URP and Shader Graph for Stunning Visuals, shows how to use one of the latest Unity render systems (Universal Render Pipeline, or URP) and how to create effects with the Shader Graph feature.

Chapter 11, Captivating Visual Effects: Harnessing Particle Systems and Visual Effect Graph, teaches you how to create visual effects such as water and fire using the two main Unity tools for doing so, Particle Systems and VFX Graph, and how to make scripts that control them according to what’s happening in the game.

Chapter 12, Enlightening Worlds: Illuminating Scenes with the Universal Render Pipeline, looks at lighting, which is a concept big enough to have its own chapter. Here, we will deepen our knowledge of the Universal Render Pipeline, specifically its lighting capabilities.

Chapter 13, Immersive Realism: Achieving Fullscreen Effects with Post-Processing, teaches you how to add a layer of effects on top of your scene graphics using the postprocessing feature of the Universal Render Pipeline to get that film effect most modern games have today.

Chapter 14, Harmonious Soundscapes: Integrating Audio and Music, covers a topic that is underestimated by most beginner developers; here we will learn how to properly add sound and music to our game, taking into consideration its impact on performance. This also covers how to script the sound.

Chapter 15, Interface Brilliance: Designing User-Friendly UI, looks at the User Interface (UI). Of all the graphical ways to communicate information to the user, the UI is the most direct one. We will learn how to display information in the form of text, images, and life bars using the Unity UI system, and also how to script the UI.

Chapter 16, Next-Gen UI: Creating Dynamic Interfaces with UI Toolkit, looks at UI Toolkit, which is the successor of Canvas, the UI system we learned about in the previous chapter. We will explore it to get ahead and be prepared for Unity’s use of this HTML-based toolkit in the future.

Chapter 17, Animated Realities: Creating Animations with Animator, Cinemachine, and Timeline, Cinemachine, and Timeline, takes us further than the static scene we have created so far. In this chapter, we will start moving our characters and creating cutscenes with the latest Unity features to do so, and how to script them.

Chapter 18, Performance Wizardry: Optimizing Your Game with Profiler Tools, discusses how making our game perform well is no easy task, but is certainly needed to release it. Here, we will be learning how to profile our game’s performance and tackle the most common performance issues.

Chapter 19, From Prototype to Executable: Generating and Debugging Your Game, teaches you how to convert your Unity project into an executable format to distribute it to other people and run it without Unity installed.

Chapter 20, AR/VR, teaches you how to create an AR application with Unity’s AR Foundation package, one of the most recent ways to create AR applications with Unity.

Chapter 21, Massive Worlds: Introduction to DOTS, teaches you how to start creating projects with DOTS, the new Unity technology that allows the creation of highly performant games to create complex gameplay involving thousands of objects on scene.

To get the most out of this book

You will be developing a full project through the chapters of this book, and while you can just read the chapters, I highly recommend you practice all the steps in this project as you advance through the book so you can get the experience needed to properly learn the concepts demonstrated here. The chapters have been designed so you can customize the game and not create the exact game shown in the book. However, I recommend not deviating too much from the main idea.

The project files have been split into a folder per chapter and have been designed in a cumulative way, each folder having just the new files introduced by the chapter or the changed ones. This means, for example, that if a file hasn’t changed since Chapter 1, you won’t find it in Chapter 2 onward; those chapters will just use the file introduced in Chapter 1. This allows you to see just what we changed in each chapter, easily identifying the needed changes, and if for some reason you can’t finish, for example, Chapter 3, you can just continue with Chapter 4’s steps on top of Chapter 3. Also note that Chapters 15 to 19 will have two versions of the files: the C# ones and the Visual Scripting ones.

Software/hardware covered in the book

OS requirements

Unity 2023.2

Windows, macOS X or Linux (any)

Visual Studio 2023 Community

Windows or macOS X (any)

XCode 15

macOS X

While we will see how to use XCode 15, it is not required for most of the chapters. Also, there are alternatives to Visual Studio in Linux, like Visual Studio Code.

If you are using the digital version of this book, we advise you to type the code yourself or access the code via the GitHub repository (link available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

Download the example code files

The code bundle for the book is hosted on GitHub at https://github.com/PacktPublishing/Hands-On-Unity-2023-Game-Development-Fourth-Edition. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://packt.link/gbp/9781835085714.

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. For example: “Mount the downloaded WebStorm-10*.dmg disk image file as another disk in your system.”

A block of code is set as follows:

<ui:Scroller high-value="100"
                direction="Horizontal"
                 value="42" />

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

<ui:Scroller high-value="100"
                direction="Horizontal"
                 value="42" />

Bold: Indicates a new term, an important word, or words that you see on the screen. For instance, words in menus or dialog boxes appear in the text like this. For example: “Select System info from the Administration panel.”

Warnings or important notes appear like this.

Tips and tricks appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: Email feedback@packtpub.com and mention the book’s title in the subject of your message. If you have questions about any aspect of this book, please email us at questions@packtpub.com.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you reported this to us. Please visit http://www.packtpub.com/submit-errata, click Submit Errata, and fill in the form.

Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at copyright@packtpub.com with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit http://authors.packtpub.com.

Share your thoughts

Once you’ve read Hands-On Unity Game Development, Fourth Edition we’d love to hear your thoughts! Scan the QR code below to go straight to the Amazon review page for this book and share your feedback.

https://packt.link/r/1835085717

Your review is important to us and the tech community and will help us make sure we’re delivering excellent quality content.

Download a free PDF copy of this book

Thanks for purchasing this book!

Do you like to read on the go but are unable to carry your print books everywhere?

Is your eBook purchase not compatible with the device of your choice?

Don’t worry, now with every Packt book you get a DRM-free PDF version of that book at no cost.

Read anywhere, any place, on any device. Search, copy, and paste code from your favorite technical books directly into your application. 

The perks don’t stop there, you can get exclusive access to discounts, newsletters, and great free content in your inbox daily

Follow these simple steps to get the benefits:

  1. Scan the QR code or visit the link below

    https://packt.link/free-ebook/9781835085714

  2. Submit your proof of purchase
  3. That’s it! We’ll send your free PDF and other benefits to your email directly
lock icon The rest of the chapter is locked
Next Chapter arrow right
You have been reading a chapter from
Hands-On Unity Game Development - Fourth Edition
Published in: Jan 2024 Publisher: Packt ISBN-13: 9781835085714
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}