Universal Stats Class for game character/objects
What is the best way to store universal stats that apply to all PC/NPCs in your game? Right now I'm using a solo script with just stat declarations like HP, Max HP, Speed, Max Speed, Strength, etc , all of them int or floats and that's all the script has. The script is pasted on every object in the game.
The other scripts in the project access this particular script with GetComponent. I heard it's a bad thing to use GetComponent too much? And I have many objects getting the stat components from each other. Would it be better to declare the Stat class as a Static Class instead and make all the stats static? Or is there a better way to do all these?
Your answer
Follow this Question
Related Questions
Game Manager can't decide what the instance of the object is despite just making an instance of it 1 Answer
Character class working along with stats? 0 Answers
Static variable resetting when it shouldn't! 0 Answers
Change value of a static variable multiple times in one script 2 Answers
How to get the component in a new class 0 Answers