Ammo increases more than 30 (ammo limit)

when i pickup ammo the player seem to be able to pickup no matter how much ammo remaining , so how to add ammo depends on the remaining ammo (numbers to 30) , and if the player has the full ammo the player can’t pick it up


It seems you do not do any check for max amount, therefore it clearly will go over 30.

You need something like in this (not the only solution, but the easiest to understand, I suppose):

You can also set max amount variable default value to 30, and make it editable on instance and have it set separately for every player(or enemy), if there is a need.

thanks alot , it worked !