Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Hands-On Unity 2022 Game Development
Hands-On Unity 2022 Game Development

Hands-On Unity 2022 Game Development: Learn to use the latest Unity 2022 features to create your first video game in the simplest way possible , Third Edition

Arrow left icon
Profile Icon Nicolas Alejandro Borromeo
Arrow right icon
$19.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.7 (22 Ratings)
Paperback Oct 2022 712 pages 3rd Edition
eBook
$24.99 $35.99
Paperback
$44.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Nicolas Alejandro Borromeo
Arrow right icon
$19.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.7 (22 Ratings)
Paperback Oct 2022 712 pages 3rd Edition
eBook
$24.99 $35.99
Paperback
$44.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$24.99 $35.99
Paperback
$44.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Hands-On Unity 2022 Game Development

Editing Scenes and Game Objects

In this chapter, we will develop some base knowledge of Unity in order to edit a project, and learn how to use several Unity editor windows to manipulate our first scene and its objects. We will also learn how an object, or GameObject, is created and composed, and how to manage complex scenes with multiple objects using Hierarchies and Prefabs. Finally, we will review how we can properly save all our work to continue working on it later.

Specifically, we will examine the following concepts in this chapter:

  • Manipulating scenes
  • GameObjects and components
  • Object Hierarchies
  • Prefabs
  • Saving scenes and projects

Manipulating scenes

A scene is one of the several types of files (also known as assets) in our project. A “scene” can be used for different things according to the type of project, but the most common use case is to separate your game into whole sections, the most common ones being the following:

  • Main menu
  • Level 1, Level 2, Level 3, etc.
  • Victory screen and lose screen
  • Splash screen and loading screen

In this section, we will cover the following concepts related to scenes:

  • The purpose of a scene
  • The Scene View
  • Adding our first GameObject to the scene
  • Navigating the Scene View
  • Manipulating GameObjects

So, let’s take a look at each of these concepts.

The purpose of a scene

The idea of separating your game into scenes is so that Unity can process and load just the data needed for the scene. Let’s say you are in the main menu; in such a case, you will have only the textures...

GameObjects and components

We talked about our project being composed of assets (the project’s files), and that a scene (which is a specific type of asset) is composed of GameObjects; so, how can we create an object? Through a composition of components.

In this section, we will cover the following concepts related to components:

  • Understanding components
  • Manipulating components

Let’s start by discussing what a component is.

Understanding components

A component is one of several pieces that make up a GameObject; each one is in charge of different features of the object. There are several components that Unity already includes that solve different tasks, such as playing a sound, rendering a mesh, applying physics, and so on; however, even though Unity has a large number of components, we will eventually need to create custom components sooner or later.

In the next image you can see what Unity shows us when we select a GameObject...

Object Hierarchies

Some complex objects may need to be separated into sub-objects, each one with its own components. Those sub-objects need to be somehow attached to the main object and work together to create the necessary object behavior.

In this section, we will cover the following concepts related to objects:

  • Parenting of objects
  • Possible uses

Let’s start by discovering how to create a parent-child relationship between objects.

Parenting of objects

Parenting consists of making an object the child of another, meaning that those objects will be related to each other. One type of relationship that happens is a Transform relationship, meaning that a child object will be affected by the parent’s Transform. In simple terms, the child object will follow the parent, as if it is attached to it. For example, imagine a player with a hat on their head. The hat can be a child of the player’s head, making the hat follow the head while...

Prefabs

In the previous example, we created lots of copies of our enemy around the scene, but in doing so, we have created a new problem. Let’s imagine we need to change our enemy and add a Rigidbody component to it, but because we have several copies of the same object, we need to take them one by one and add the same component to all of them. Maybe later, we will need to change the mass of each enemy, so again, we need to go over each one of the enemies and make the change, and here we can start to see a pattern. One solution could be to select all the enemies using the Ctrl key (Command on a Mac) and modify all of them at once, but that solution won’t be of any use if we have enemy copies in other scenes. So, here is where Prefabs come in.

In this section, we will cover the following concepts related to Prefabs:

  • Creating Prefabs
  • Prefab-instance relationship
  • Prefab variants

Let’s start by discussing how to create and use Prefabs...

Saving scenes and projects

As in any other program, we need to save our progress. The difference here is that we don’t have just one giant file with all the project assets, but several files for each asset.

Let’s start saving our progress by saving the scene, which is pretty straightforward. We can simply go to File | Save or press Ctrl + S (Command + S on a Mac). The first time we save our scene, a window will ask us where we want to save our file, and you can save it wherever you want inside the Assets folder of our project, but never outside that folder; otherwise, Unity will not be capable of finding it as an asset in the project. That will generate a new asset in the project window: a scene file. In the following screenshot you can see how I saved the scene, naming it test, and now it shows up in the Project panel:

Figure 2.37: Scene files

We can create a folder to save our scene in the save dialog, or, if you already saved the scene, you can create...

Summary

In this chapter, we saw a quick introduction to essential Unity concepts. We reviewed the basic Unity windows and how we can use all of them to edit a full scene, from navigating it, then creating premade objects (Prefabs), to manipulating them to create our own types of objects using GameObjects and components. We also discussed how to use the Hierarchy window to parent GameObjects to create complex object Hierarchies, as well as creating Prefabs to reutilize and manipulate large amounts of the same type of objects. Finally, we discussed how we can save our progress.

In the next chapter, we will learn different tools like the Terrain system and ProBuilder to create the first prototype of our game’s level. This prototype will serve as a preview of where our scene will be headed, testing some ideas before going into full production.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Create the game prototype and learn the fundamentals of Unity editor to build scenes, objects and import objects
  • Add interactivity, win/lose conditions, sound, graphics and artificial intelligence using C# and visual scripting
  • Improve the game graphics, user interface, add visual effects and animations using Animator, Cinemachine, and Timeline

Description

Unity is a cross-platform game engine that provides you with powerful but simple-to-use features to solve the most common problems in Game Development, such as rendering, animation, physics, sound, and effects. You’ll learn to use these features to create simple but complete games (and all the nuances needed to handle Unity). Complete with hands-on tutorials and projects, this book will teach you to use the Unity game engine, create C# and visual scripts, integrate graphics, sound, and animations, and manipulate physics to create interesting mechanics for your game. You’ll then code a simple AI agent to challenge the user and work with profiling tools to ensure code efficiency. Finally, you'll work with Unity's AR tools to create AR experiences for 3D apps and games before publishing them to the world. If you are interested in creating impressive, commercial-quality games that are playable on a variety of platforms, then you’ve come to the right place.

Who is this book for?

Both game and non-game developers who wish to migrate or start building 3D games in Unity will find this book useful. While you'll still able to follow along if you don't have any programming experience, knowing the fundamentals of C# programming will help you get the most out of this book.

What you will learn

  • Build a game prototype that includes gameplay, player and non-player characters, assets, animations, and more
  • Set up and navigate the game engine to dive into the Unity Editor and discover unique and new features released in 2022
  • Learn both C# and Visual Scripting to customize player movements, the user interface, and game physics
  • Apply shaders to improve your game graphics using Shader Graph and Universal Render Pipeline (URP)
  • Create win-lose conditions for the game by using design patterns such as Singleton and Event Listeners
  • Implement Game AI to build a fully functional enemy capable of detecting and attacking the player
  • Debug, test, optimize, and create an executable version of the game to share with your friends

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Oct 31, 2022
Length: 712 pages
Edition : 3rd
Language : English
ISBN-13 : 9781803236919
Languages :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Oct 31, 2022
Length: 712 pages
Edition : 3rd
Language : English
ISBN-13 : 9781803236919
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 126.97
Unity 3D Game Development
$36.99
Hands-On Unity 2022 Game Development
$44.99
Learning C# by Developing Games with Unity
$44.99
Total $ 126.97 Stars icon

Table of Contents

22 Chapters
Creating a Unity Project Chevron down icon Chevron up icon
Editing Scenes and Game Objects Chevron down icon Chevron up icon
Grayboxing with Terrain and ProBuilder Chevron down icon Chevron up icon
Importing and Integrating Assets Chevron down icon Chevron up icon
Introduction to C# and Visual Scripting Chevron down icon Chevron up icon
Implementing Movement and Spawning Chevron down icon Chevron up icon
Physics Collisions and Health System Chevron down icon Chevron up icon
Win and Lose Conditions Chevron down icon Chevron up icon
Implementing Game AI for Building Enemies Chevron down icon Chevron up icon
Materials and Effects with URP and Shader Graph Chevron down icon Chevron up icon
Visual Effects with Particle Systems and Visual Effect Graph Chevron down icon Chevron up icon
Lighting Using the Universal Render Pipeline Chevron down icon Chevron up icon
Full-Screen Effects with Post-Processing Chevron down icon Chevron up icon
Sound and Music Integration Chevron down icon Chevron up icon
User Interface Design Chevron down icon Chevron up icon
Creating a UI with the UI Toolkit Chevron down icon Chevron up icon
Creating Animations with Animator, Cinemachine, and Timeline Chevron down icon Chevron up icon
Optimization with Profiler, Frame Debugger, and Memory Profiler Chevron down icon Chevron up icon
Generating and Debugging an Executable Chevron down icon Chevron up icon
Augmented Reality in Unity Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.7
(22 Ratings)
5 star 81.8%
4 star 9.1%
3 star 4.5%
2 star 4.5%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Jay (Vijayasimha BR) Feb 04, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(Review copy provided by Publisher)I have myself handled a couple of training batches on Game Development (Unity, Unreal, P5.JS 2D game development). Games are a visual medium, and hence are better learnt visually. However, a handy book reference is always useful when you are learning so many things and want to quickly reference different topics in a book format.That is where, I appreciate what this book does. As it suits a gaming book, the author has provided detailed in-depth images. I would say, almost every page is filled with images, and goes on for explanations for each image.Another thing I appreciate is the explanations for both visual scripting and C# based scripting simultaneously. This is particularly for students who may want to do visual scripting on the first run of learning. Then, on the second run, dig into the more hardcore code-based scripting. That is a good touch. This might appear overkill because, you can get away without any coding at all with modern engines like unreal, but, if you already background in providing, this can save you a lot of time.Lastly, the book starts with beginners and goes on till expert topics. Like, it is a massive book. So, those who want to only learn the basics and start building can stop after the first few chapters, and then, return for more advanced learning on future runs.Seriously, if you are learning game development, you have to do multiple runs. That is the way it is. Anyway, all in all, as a coding tutor, this book is good is what I am trying to say.
Amazon Verified review Amazon
Dan Mar 30, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I've been working with Unity since 2015, so I can't offer a true beginner's experience. However, I have largely focused on 2D games, and have been using this book as way to dip my toe into 3D and I've not previously used many of the tools that Nicolas outlines here.The book begins with the absolute basics - how to install Unity and set up your game project. From there, you'll walk through some more basics to familiarize you with the 3D Scene Editor. After the first couple of chapters to get you comfortable with Unity and 3D, the rest of the book is focused on building a full project from start to finish. So, while this book could definitely be used as a reference, I think it would most suitably be used to gain the insights from building the project that's outlined.I am not fully through the book, but my personal experience with this book has been positive so far. I skimmed the first chapter, as I was already familiar with installing Unity and creating a Project. The 3D recap was a good refresher/intro to working with 3D in Unity, I felt that it covered enough information without going into so much detail as to get boring. Working through the Project feels informative, and the pacing for each chapter feels just right to me. When it comes to writing code, it will be a mix of Visual Scripting and C#. This has been an interesting learning experience for me as well as I had not used Visual Scripting before, and I feel that it has been a good introduction. As with most Packt books on software development you'll get access to the code and assets for each chapter, so if you get stuck you can always reference that.Overall, this is a great book if you want to level up your Unity 3D skills, or if you are looking to learn Unity development and come out the other end with a finished project.
Amazon Verified review Amazon
Jtown Dec 28, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Good and fast delivery, book in great condition!
Amazon Verified review Amazon
elian Nov 14, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Unity 2022 Game Development is worth a look through for anyone who wants to start creating games as a passion or for anyone looking to develop a new skill. Nicolas Alejandro Borromeo does a good job of breaking down all of the sections within the game development life-cycle while teaching the reader how to use Unity to create their rendition of the project. Going over from the simplest concepts of making a Unity project, creating prefabs, and terrain. All the way to height maps, C# scripting, and proper allocation of resources. The chapters are thoroughly filled with information pertaining what part of the game's life cycle the game is at, and the actions that should be taken to continue the development of the game. While also being easy to follow along, you really do not have to have any prior experience with Unity to read through this book and you can still learn something from this book even with prior experience wherever you are on your journey with game development. I would say the only negative is that the chapters are not long enough to fully go into more detail of how to use certain tools and how to use Unity to the fullest potential, but for what the book is trying to do, I would say that this isn't a huge problem. I enjoyed reading and learning more about game design and development with Unity, I hope you guys like it too!
Amazon Verified review Amazon
Maria Dec 23, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
As a Unity Veteran, I can say this book so far has been very informative. I can say this book can be for beginners as well as for advanced developers looking to get into the new Unity topics or get a refresher on the engine’s new topics. I like that the book had the new Unity UI toolkit documentation as well as basic knowledge of shaders. I would recommend anyone looking to learn unity or get updated to obtain this book! - Giovanni Sierra
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.