Question by
ItzChris92 · May 07, 2017 at 11:08 AM ·
variablesclassesrandom.rangegeneric
Random.Range for player stats
So I've got my player stats functioning correctly, but I would now like to edit a couple of them to accept a range of values rather than set values. So I thought maybe I could use Random.Range for this, but the problem with this is I have to declare the variable amount in the script for this to work. This isn't what I need as my 'PlayerStats' and 'EnemyStats' classes are going to be generic across various 'Player' and 'Enemy' objects. Does anyone have any advice on how I would go about this?
Also, semi-on topic, I also wanted to know where variable values entered on the inspector are actually read from and written to?
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612121451im_/https://answers.unity.com/themes/thub/images/avi.jpg)