[Help me ] boss battle

Hello , i want to make a boss battle after 8 times the enemy position is been destroyed (now i have 3 types of enemy) but i don’t know how to spawn only one enemy in the center of the game space .
this is my code for the other enemies (for who wants to make new enemy)
where “times” are the times that the formation is refilled

> if (times > 8)
>         {
>             GameObject enemy3 = Instantiate(enemyPrefab3, freePos.position, Quaternion.identity) as GameObject;
>             enemy3.transform.parent = freePos;
>             times = 3;
>         }
>         if (times > 4&& times<7)
>         {
>             GameObject enemy2 = Instantiate(enemyPrefab2, freePos.position, Quaternion.identity) as GameObject;
>             enemy2.transform.parent = freePos;
>             times++;
>         }
>         else { 
>         GameObject enemy = Instantiate(enemyPrefab, freePos.position, Quaternion.identity) as GameObject;
>         enemy.transform.parent = freePos;
>             times++;
>         }

maybe i should change the freepos.position with the center of the game space or i need to do other things?

Privacy & Terms