Hi,
I’m creating a mini game that involves sliders and I am unable to figure out how to achieve the result I am looking for.
The slider can go from 0 to 1 and the goal is to find the correct value by moving the slider, for example, 0.3 . As I the slider value reaches the threshold of 0.2 I want to gradually change a material parameter, for example, opacity. Once it reaches 0.3 in this case the opacity should be at 1 but once the slider value is greater than 0.3 I want the opacity to decrease until it reaches 0.4.
I am stuck because I don’t know how to get the direction of the slider (if I am increasing or decreasing slider value). My idea was to store old slider value as a variable and then compare with the current slider value but how do I set the old value so that it wouldn’t be equal to the current slider value? Or maybe there is a better way?
Thanks