Since it is not challenging enough, let’s limit the amount of times the player can fire.

First we will need to add a variable to our player script as below:

Then we will need to add the below to the playerMovement() method of our player script:

As can be seen, we have created a call to a function() called AmmoCount and have passed an int 1 to it. We now need to create that function in the player script, as below: