Day 13: Spawning Objects in Unity without The Clutter.

Jonathan Fagan
2 min readDec 16, 2022

--

Objective: A quick way to keep your hierarchy clean.

Welcome back we are up to lucky number 13. But let’s get back to it. Today we are Spawning Objects without the clutter.

So we got our Spawn Manager spawning enemies. However if we look at our heirachy it’s getting pretty clutter pretty quickly. So one way of clearing things up is to Parent all of our clones to an object. Parents will allow our clones to stay in a “Group” so to speak so we can cleanly see what’s going on and how many objects we may in a scene.

And this is how we do it.

We Instantiate a clone of the _enemyPrefab and assign it to a variable of type GameObject. We then assign an empty gameObject as the parent to each clone object and poof it’s clean.

Without parenting
With Parenting

Happy Dev’ing.

--

--