I have a strength stat setup in a Manager script that is using that variable to affect other variables and functions.
Right now I'm trying to work out a weight limit with weapons so that it checks your strength stat and if the strength stat is above the threshold, then speed is not affected and the player isn't slowed down.
If the Player is above the Min Strength Requirement, then the player isn't slowed by the weight of the weapon, there is no check of the list and the game goes back to business as usual, but if the stat is under the Min Strength Required value, then it goes through the List in each element to check if it falls in the range of the Min or Max in each element, and if the Strength stat falls within one of those elements, that Player movement speed would be the speed value in that element.
The way I have it setup is like this:
![alt text][1]
base.Initialization();
if (_strength >= _minStrengthRequired)
{
_needsStrength = false;
Debug.Log("Don't Need Strength");
return;
}
// this is where I would like to do an a check and
// see where it would fall in the range and adjust
// the speed value based on that range
How would I check the range of each element in this list, then find out which element the strength stat would fall into?
I'm using a list because some weapons do not have this requirement, and heavier weapons will have more elements because it depends on the strength more.
Million dollar question: How do I make sure to check the size of the elements in the equipped weapon, compare each of the min and max values with my strength stat, then finally check which element the strength stat falls into based on the min and max range? This would then allow me to override the movement speed value with the speed value.
Thanks! Hope this makes sense!
[1]: /storage/temp/127398-strength.png
↧