Creating a Triple Shot Powerup: Part 1

Sherry Fisher
3 min readJul 13, 2023

--

Objective: Create a powerup to give the game some excitement.

So far in this game development, we have gone from prototyping to adding assets. Now it is starting to look like a real game, but we still have a ways to go. Currently, our player can only shoot one laser at a time. In this step, we are going to create a triple shot.

First I drag my laser from the prefab folder into the Hierarchy so it appears in our scene. Then I duplicate it twice.

Duplicating laser to create 3 lasers for our triple shot.
Creating the 3 lasers

Next I need to position the new lasers into the correct locations. For the two new lasers on the wings, I make sure the Y values are the same (-0.3) and the X values are opposites (-0.79 and 0.79) so they instantiate at the same position for each wing.

Now that the triple shot is set up, I create an empty GameObject and call it Triple_Shot. I then drag the three lasers into the Triple_Shot object and then drag the Triple_Shot object into my Prefab folder and delete the one in the Hierarchy to remove from scene.

Now that I have the triple shot created, I need to add it to the FireLaser() method. First I need to create variables in the script, one for the triple shot prefab and one to check if the triple shot is active.

Now I use an if-else statement to determine if the triple shot is active. If it is active, all three lasers will fire. If not, then just the one will fire.

It is time now to bring in the triple shot asset. I drag it from the asset folder to the Hierarchy. It is a bit big, so I resized it to fit better into the game.

As with our other gameobjects, I add a collider and a rigidbody, again making sure IsTrigger is checked and gravity is set to 0. I also edit the collider to fit the size of the powerup. Now I create the script for it and attach it to the Triple_Shot_Powerup gameobject.

In the next article, I will create the script to control the powerup’s behavior.

--

--