So i’m making a 2d Shooter game with C#. and i’ve made multiple guns (for example a handgun and an assault rifle) , i attached the same script on both of these guns , and they both have the same variables but i changed them in the inspector so they have different characteristics. How can i change the assault rifle’s Damage without interfering with the handgun , after meeting a certain condition in-game?.
EXAMPLE:
The assault rifle’s damage is 50 , the handgun’s is 30. the player buys an upgrade for the machine gun to increase its damage by 10, how can i change the rifle’s damage without changing the handgun’s damage?.
i’ve looked for an answer for like 2 hours today and i’ve got nothing :(.
Thanks for any help!!.