
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)

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.

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.


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