Day 13: Adding the powerup to your spawn manager

Jake Boere
May 20, 2021

Objective: We want to add the triple shot power up to our spawn manager so that it spawns both enemies and the power ups.

First, in our spawn manager script we need to add a new IEnumerator to handle the spawn routine for the power up.

Then, in the spawn routine we need to instantiate our power up prefab so that it spawns at a random position on the X axis at the top of the screen and then we need to yield return so that it spawns between different times.

Lastly, we need to start the coroutine in void start and we need to stop spawning them when the player dies.

This is how to start the coroutine.
This method can handle stopping everything from spawning when the player dies.

--

--

Jake Boere

I am hard working Game development student learning as much about game development and unity as possible.