- Home /
I am trying to make a shop system but I am having this doubt
In my shop I have 4 different 2d models each of them have different stats like one has 100 health and the other has 200 with 50 armor health. So my question is how am I supposed to give them these stats because for the first model that player gets when he start playing the game for first time he/she will get a default model with 100 health but if he/she buys other model in the shop its stat will be different so should I make those stats in the player health script that is attached to the default model or make different scripts holding each model stat separately.
Thank you,
Answer by djenningsais · Jan 13, 2021 at 01:34 PM
Assuming that the player object has its own health variable, it sounds like you are wanting to add a modifier to their stats based on equipped items.
If so, the item object would need its own health variable. Then the player would use a total health variable combining the 2 (or more) variables.
Depending on how many items can be equipped you may even want to create a script separate from both Player and Item to handle the total health or total stats depending on how many stats there are.
Your answer
Follow this Question
Related Questions
How to check which gameobject is the player using 2 Answers
character model draw calls 1 Answer
Jump animation with a little bounce like towerfall 0 Answers
multiple models same animation 1 Answer