private void CreateMob(Vector2 loc) { GameObject go = op.GetPooledObject(); if (go != null) { if (!go.activeInHierarchy) { go.transform.position = loc; go.GetComponent <Entity>().Respawn(); go.SetActive(true); el.AddToList(go.GetComponent <Enemy>()); } else { Debug.Log("active in hierarchy, cannot add to list"); } go.SetActive(true); lastSpawn[index] = go.GetComponent <Enemy>(); } }