Recently, I’ve been trying to integrate weapon selection in the main menu of my game project. The problem is that I can’t get the weapon’s stat (ammo, fire rate, etc.) to work correctly.
Here are some screenshots for explanation:
As you can see, in the first event, I apply values on the variables of “PlayerHand” for “Weapon 0” (default weapon).
Then, I have “PlayerHand” fire bullet to change values based on the values of the variable in the second.
When I set “PlayerHand” fire bullet behavior to 0 and test it out, things like ammo refill itself happened.
Alright, did you set the variable MaxAmmo to 0 in your events? If you just change the stats in the behavior menu but then assign different values in your events, the values from your events will be used. Since you have no condition, the max value will be assigned each frame and you get unlimited ammo.