Unity Hierarchy Clutter

One trick I recently learned for Unity is that you can use parents to reduce the number of objects that show up in the Hierarchy. This is especially useful for objects spawned at run time, because every game object shows up in the Hierarchy list, which means every enemy, every item, every bullet, which can get to be a lot.

Poof, no more clutter

Note here that _container as the parent object cannot be referenced directly, nor can the object we are assigning as a child. Unity considers the transform of an GameObject it’s root, so pretty much any time we do anything with game objects, we’re doing it to the object’s transform which describes physical existence inside the game scene.