-
Trigger a linear function between two values of a slider multiple times
Hi! I’m trying to come up with a sollution that allows me to do the following:
I have a slider controler, and I need to use it to trigger some properties. The problem I’m having is that I need to trigger an specific property between two values of the slider.
For example
src= slider;
src between 4 and 8
x=linear(src,4,8,10,20)
src between 9 and 20
x=25
src between 21 and 28
x=linear(src,21,28,110,120)
…
Right now I’m trying to use the switch operator, but I think i’m doing something wrong:
r=0
switch(r){
default:
(anim !=3 && anim!=4)
r=0;
break;
case 0:
(anim==3 && src>=3 && src<=7)
r=easeIn(src,3,7,0,2);
break;
case 1:
(anim==3 && src>7)
r=2;
break;
case 2:
(anim==4)
r=2;
break;
};
Is there a way to achieve that?
Thanks in advance!