Spawning Objects in Unity without the Clutter

Jared Amlin
Geek Culture

--

When spawning multiple enemies in Unity through a spawn manager game object, it doesn’t take very long before the hierarchy window becomes overrun with an ever-increasing list of enemy game objects. It’s easy to imagine how adding multiple enemy types as well as other assorted game objects would quickly make for a very messy hierarchy. It becomes difficult to scroll through all of the game objects in your scene view looking for one object in particular when there is no organization. As you can see by the GIF below, even a small handful of enemies being generated every few seconds will rapidly fill the hierarchy window.

An easy way to organize these spawning enemies and keep your hierarchy under control is to create an empty game object to store the newly spawning enemies. Here I call the new empty object Enemy Container and make it a child of the Spawn Manager. This way all of the enemies will spawn, and more importantly list, in the enemy container, which can be viewed or closed with a drop-down arrow. This is really handy for being able to view all of my enemies in the scene when I want to, but otherwise keeping the hierarchy clean when I don’t.

Now that my hierarchy is all clean and organized, I can focus on dodging all of the incoming enemies!

--

--

Jared Amlin
Geek Culture

I am an artist and musician, that is currently diving headfirst into game development with C# and Unity3D.