Upgrading the Ammo Count

Tyler Henry
2 min readSep 20, 2022

Objective: upgrading the Ammo count to reflect current/Max ammo

So, we are going to be upgrading our Ammo count and make it to where we can hold more ammo when we get another ammo pickup.

Alrighty so in this short video when I pick up the ammo it is then added to my current ammo out of max ammo.

Alright so let's go to our Player script and then take a look there.

We add the max ammo private int so that we can have a reference.

Then we make this if statement right here so that we add ammo up to the maximum.

Then nothing here is changed whatsoever so keep it as is.

Then in our Ui manager script we update the code in here to say this. That is all there is to it. Pretty simple overall and if I wanted to, I could make the max ammo count higher if I wanted to make it easier on myself.

--

--