I'm trying to instantiate a new group of enemies once the player manages to shoot every enemy in the parent group however when I do that the counter for the number of children stay at zero as a non stop wave of enemies spawns in. I know this is because the original parent that the script is referencing is still at zero since all I am doing is spawning in a new group. My question is, Is there a way to either repopulate original group of children to the parent, or is there a way to replace the old parent with the newly instantiated group?
code for reference
if(enemyHolder.childCount == 0)
{
Instantiate(enemyGroup, enemySpawn.position, enemySpawn.rotation);
}
code for reference
if(enemyHolder.childCount == 0)
{
Instantiate(enemyGroup, enemySpawn.position, enemySpawn.rotation);
}
Comment