Road TO Dev — Out of ammo? Reload!
Well now we have our player able to lose ammo and have a set max amount which is a great first step now we need a way to replenish this ammo. To start we need to create the ammo powerup just as we did the others.
Setup the box collider and attach the powerup script don’t forget to toggle Is Trigger as I did in the next image.
Then we need to setup the powerup ID to whatever you need and add the new case we will want to use for this specific powerup.
Now we can create that ammo reload method on our player and have it set to go back to 25 upon pickup. Also make sure to toggle hasAmmo back on.
Remember to extend the numbers for the array on the spawn manager
Lastly attach the new powerup to the spawn manager
I am going to animate my powerup you can if you want. Now we should have an ammo powerup that spawns and fills our ammo back up once picked up.