I'm very new to Unity, and for the most part game creation. Even so, this is such a simple issue I feel kind of dumb for not being able to solve it haha.
I have a stats script attached to each of my game objects that keeps track of things like health, mass, damage, etc. It also holds special functions that are for each instance of that object. Then I have a weapon, say a lazer gun. That lazer needs to access the health variable in that stats script. The problem is, that stats script is a different script in every single object I have. For instance, I have PlayerShipStats, or JunkBlockStats, etc.
I can't use `getComponent` because the lazer also needs to be able to access `getComponent` as well. Or, any other number of objects.
Is there an easy way to do this? If not, should I just make one really long script called "Stats" and condense them all? It seems terribly unorganized... Thank You for the help, or just reading at all really.