Hello @Vaughan_MacEgan, how are you?
This happens because the child of the child (position) of the formation is the enemy that is being instantiated. This code checks if there is a enemy (child) inside the position (child of the formation), and case there is not, it means that the enemy was killed. If there was a enemy childed to that position the childcount would return 1, thus meaning that this position have an alive child inside it. The transform only exists if there is an gameObject, when you destroy the gameObject, the transform os also destroyed.
3 Likes