Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
updating the spawn manager
IEnumerator SpawnPowerupRoutine()
//every 3 - 7 seconds, spawn in a powerup
while (_stopSpawning == false) {
Vector3 spawn = new Vector3(Random.Range(-8f, 8f), 7, 0);
int randomPowerUp = Random.Range(0, 4);
Instantiate(_powerups[randomPowerUp], spawn, Quaternion.identity);
yield return new WaitForSeconds(Random.Range(3, 8));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment