- Home /
i need help with my weapon stats
I have coded an inventory for the weapons that I am going to put into the game and it displays it on a bar to show what weapon I have and I can remove it and pick it back up. but I want to be able to make the weapon change the stats of the character such as damage, range, and attack rate when its in the inventory and when it is removed from the inventory those stats are removed and the damage, range and rate are back to 0. the iron sword stats code is on the weapon icon which is on the UI inventory.
Answer by eplaygame · Apr 18, 2021 at 04:30 PM
As I understand -- You want to store new values of your variables. If so, read aboud ScriptableObject. These objects allows to save new data even when you exit the game.
@eplaygame ok I have had to just fix scripts that broke while I was doing this but as far as I got is being able to make different scriptable objects with different stats like attack range and damage but I'm having trouble being able to implement it into the players combat stats and having the icon of the weapons appear in the inventory. I'm gonna try a few things but some assistance/guidance to the general direction I need to go would be helpful.
Your answer
Follow this Question
Related Questions
How would go about making a weapon pick up? 3 Answers
Weapon Pickup and change 2 Answers
Java for android script help??? 0 Answers
[Photon] rpc error Exception: cannot serialize(): UnityEngine.CapsuleCollider 2 Answers
Pickup Counter Script 2 Answers