I'm building an ammo system in a game. Basically I have 3 guns, pistol, minigun, and rifle. The pistol is single fire, the other two are automatic. I have a global variable set to 0, for ammo, and an item to pick up which adds to that variable. I also have systems where if ammo is below zero, the gun doesnt spawn a bullet.
It's fairly simple but refuses to work. I set a text box to the ammo variable, to track it and see if it was counting right. I walk over the pickup item, and boom, nothing is added to the text number. This might just be an issue with text boxes.
The automatic guns use "Left Mouse is down" to register their automatic fire. I made a thing that corresponds, with "Left button is down", and subtracts from the "Ammo" variable every second. But for some reason, the automatic guns ignore the ammo count entirely and fire regardless. This makes no sense. I have parameters in place where if "Bullet on created, if Ammo = 0, destroy Ammo". This means that the bullet shouldnt be firing if the Ammo variable is zero, regardless of what gun. I'm utterly lost and cannot comprehend how this isn't working. Thanks.