Reader small image

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

Product typeBook
Published inJan 2024
PublisherPackt
ISBN-139781835085714
Edition4th Edition
Tools
Right arrow
Authors (2):
Nicolas Alejandro Borromeo
Nicolas Alejandro Borromeo
author image
Nicolas Alejandro Borromeo

Nicolas is a Game Developer currently working as a Senior Software Development Consultant for Unity in London. He is a Unity Certified Instructor teaching Unity clients all around the globe. He started using Unity in 2008 and teaching it in 2012 in several Universities and Education Institutes.
Read more about Nicolas Alejandro Borromeo

Juan Gabriel Gomila Salas
Juan Gabriel Gomila Salas
author image
Juan Gabriel Gomila Salas

Juan graduated in mathematics with a master's degree in Teacher Training, specializing in Game Design for social casino video games and as a video game developer using Unity and Unreal Engine for both PC and mobile. He was an online teacher on Udemy from 2015 to 2022 and subsequently on his own platform Frogames Training with over 150 online courses and over 500,000 students across 130 countries.
Read more about Juan Gabriel Gomila Salas

View More author details
Right arrow

Managing GameObjects using Prefabs

In the previous example, we created lots of copies of our enemy around the scene, but in doing so, we 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.

Creating Prefabs...

lock icon
The rest of the page is locked
Previous PageNext Chapter
You have been reading a chapter from
Hands-On Unity Game Development - Fourth Edition
Published in: Jan 2024Publisher: PacktISBN-13: 9781835085714

Authors (2)

author image
Nicolas Alejandro Borromeo

Nicolas is a Game Developer currently working as a Senior Software Development Consultant for Unity in London. He is a Unity Certified Instructor teaching Unity clients all around the globe. He started using Unity in 2008 and teaching it in 2012 in several Universities and Education Institutes.
Read more about Nicolas Alejandro Borromeo

author image
Juan Gabriel Gomila Salas

Juan graduated in mathematics with a master's degree in Teacher Training, specializing in Game Design for social casino video games and as a video game developer using Unity and Unreal Engine for both PC and mobile. He was an online teacher on Udemy from 2015 to 2022 and subsequently on his own platform Frogames Training with over 150 online courses and over 500,000 students across 130 countries.
Read more about Juan Gabriel Gomila Salas