Chapter 34: Secondary Fire Power

Joshua Kidd
Nov 29, 2023

--

To create the choice of Secondary Fire Power Power-up by using the Speed Boost Power-up as a blue print to created a Machine gun mechanic first by creating a:

private bool variable

Next created a new public void called HeavyFire() and under it created a new statement to active the Secondary Weapon. Including a StartCourtine to help create a time-out statement for the power-up.

Now create the time limit for the power-up to last using IEnumerator. Its important to include:

var = false

with the ammo count mechanic that's created so your player won’t have unlimited ammo if they're supposed to be a cap off point for the ammo.

The most important thing under void Update create an if statement that when the space bar is held it detect the power-up is active.

--

--