Spawning triple shot powerup in Unity

Rusben Guzman
Jun 1, 2021

In this scene we have a triple shot powerup prefab ready to use. For now I only tested the powerup by dropping it in the scene.

Now I’m gonna use the spawn manager object to instantiate a powerup every 7 seconds. So first I’m going to declare a GameObject variable to get the reference for the prefab and assign it to the inspector.

Now I hate to create a coroutine to instantiate the powerup every 7 seconds in a random position.

Finally in the Start method we have to use the StartCoroutine method to call the powerup spawner function.

As a result when we go to play mode we can see how the powerups appear during the game.

--

--

Rusben Guzman

A Software Engineer passionate about game dev and interactive products with Unity. I consider video games to be the artistic expression of programming.