Cleaning Up the Spawn Manager

Spawning without the clutter

As you would have noticed, after instantiating new objects within the field, the hierarchy starts to get clutter real fast, this is important because the more objects that take up space within the hierarchy, the more gets harder to track any objects. Therefore we need to have the newly spawn objects be created within a child of a parent. (Basically spawn within a folder)

Creating a child “folder” within a parent “folder”

How to create a Enemy Container

Firstly, we must create an empty game object within the spawn manager, this would be the targeted folder for the newly created game objects to spawn in. Then in back in the spawn enemy script, we have to make the script look for the newly created folder. Create an serialized field game object looking for the enemy container.

You might have noticed that it is impossible to keep track of every new game object newly spawned. To solve this issue, we shall make a newly instantiated game object into a game object itself. Then we can call that newly form enemy to spawn within the new parent.

Creating the instantiated game object into a game object

Now that we have access to the instantiated game object, its time we assign it a new parent, namely the enemy container. To do so, we take the newly instantiated game object that we just gave a name to, call the transform root and access the parent script. Then we are going to call the previously newly created empty game object as the new parent.

Assigning a new parent to the instantiated object

Hit save, and Ta-da! All newly spawned game objects will be in the Enemy Container folder.

A Designer, an Illustrator and a massive tech geek aspiring to become a professional Unity Developer.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Technical summary by the development team

Taking care of our customers at EmailOctopus

BigQuery- E-commerce dataset

How to Split Test Properly for Amazon

Understanding Audio Quality: Bit Rate, Sample Rate

How to Identify if Kubernetes Pods are Running as Root

Pantheon or DIY Hosting: Making an Informed Choice

Pantheon or DIY Hosting: Making an Informed Choice

Binary — The Way Computers Read Numbers

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Simon Truong

Simon Truong

A Designer, an Illustrator and a massive tech geek aspiring to become a professional Unity Developer.

More from Medium

Connecting easily to my BT headphones every time

What is what is a Pantone(r) color & why do they exist?

Hey Guys!!!!! Do you really think that you know the basics about JVM??

Do you know how to use sales mistakes to learn?