My issue is that whenever I hit ‘R’ to reload the gun, my current ammo increases and my spare ammo decreases. However when I was debugging, I found that my spare ammo variable would go into the negatives. Now I was instantly aware why, I set my current ammo variable to be equal to the gun’s magasine size however my problem is I tried many different ‘equations’ that have not given me a correct solution. It is probably something obvious. I am NEW to this so don’t hate on me too hard
void ReloadGun () {
AmmoToReloadFrom = AmmoToReloadFrom - (MagSize - CurrentAmmo); //Subtract the number of bullets fired from the magasine from the spare ammo
AmmoShot = MagSize - CurrentAmmo;
CurrentAmmo = MagSize;
}
This is my ReloadGun() function, the line that needs ‘fixing’ is CurrentAmmo = MagSize;
Thanks for any help at all possible, any extra information that may be required, just let me know and I will edit Cheers.