Object Pooling Cluttering Hierarchy

I’ve recently learned all about object pooling and I’ve managed to implement it into my game. I still have on issue I cant seem to figure out and its more for cleanliness than performance. Could I make the pooled objects go as a child under an empty object for ease of tracking and such?

Yes you can.

Attach your script to an empty object and add this line of code inside your for loop (the loop where you instantiate your objects)

objectToPool.transform.parent = transform;

For example, supposing your object to pool is called “obj” the whole thing will look something like this:

private void Start() 
{
	for (int i = 0; i < amountToPool; i++) 
	{
		GameObject obj = (GameObject)Instantiate (objectIWantToPool);
		obj.SetActive (false);
		pooledObjects.Add (obj);
		obj.transform.parent = transform;
	}
}

You can set the parent like what was already mentioned through setting the objects transform.parent. You can also set the parent in the instantiate call. What I do is in editor if I want things organized I will child them under a containing object, but on target devices I will not do this for performance reasons. I do this by adding an #if UNITY_EDITOR block. Check this for reasons why. Spotlight Team best practices: Optimizing the hierarchy | Unity Blog