Spawning Objects in Unity Without The Clutter

Objective: Send the enemies spawned from the spawn manager into a container to organize the scene.
The first thing we need to do is create an empty game object inside the Spawn_Manager and name it Enemy_Container.

Now we need to let our spawn manager know about the enemy container:


Since we never told the script where to put the created enemies, the enemy clone is just thrown down into the scene cluttering the hierarchy. To fix this, we can assign a variable to the newly created enemies and call it newEnemy.

The last thing we need to do is tell the newEnemy variable to create the enemy game objects in the Spawn_Container and to do this we can use:

Now all enemies created will be sent to a droplist making it much easier to navigate Unity’s hierarchy during the game.