Float Clamp

Maximuz24

Member
I think Clamp is used to clamp max and min value but when i try to set it i cannot set min or max value if i change anyone the other value will change respectively the same value.
1588702859578.png
 
Whoa, that's fun. The SharedVariables are being set to the same reference within OnReset so that's why you are getting the repeated values. If you change FloatClamp.OnReset to the following it'll fix it:

Code:
        public override void OnReset()
        {
            floatVariable = 0;
            minValue = 0;
            maxValue = 0;
        }
 
Whoa, that's fun. The SharedVariables are being set to the same reference within OnReset so that's why you are getting the repeated values. If you change FloatClamp.OnReset to the following it'll fix it:

Code:
        public override void OnReset()
        {
            floatVariable = 0;
            minValue = 0;
            maxValue = 0;
        }
Its applicable to Int Clamp As well. Thanks
 
Top