I currently have a scene where there is one enemy and if i kill him, he goes away. I want to make it so when i kill the enemy, 2 more appear and so on. **I am new to unity so i need to know where to put the script and specific step by step procedure. Thx!
The simple way would be to create a monitor script attached to an object in the level, or to the camera.
Then we can use FindGameObjectsWithTag to count them i.e.:
int enemy_count = 0;
foreach (GameObject g in GameObject.FindGameObjectsWithTag("enemy"))
enemy_count++;
for (int i = enemy_count; i < max_enemies; i++)
Instantiate("enemy");
What that does is count all your enemies, so we count 2 and max_enemies is 3, then we’ll instantiate one new one. You could also use a function called by the OnDestroy() method of enemy.