Hi guys I want to make it so the scene can change to another scene once i killed the last enemy. Here's my enemy spawner script
public GameObject enemy;
public Transform[] spawnPoints;
public Vector3 spawnValues;
public int howoften = 10;
public int howmany = 3;
public float etimer;
void Update()
{
etimer = etimer - Time.deltaTime;
if (etimer < 0)
{
etimer = howoften;
int i = howmany;
while (i > 0)
{
i--;
int spawnPointIndex = Random.Range(0, spawnPoints.Length);
Instantiate(enemy, spawnPoints[spawnPointIndex].position, spawnPoints[spawnPointIndex].rotation);
}
}
}
↧








