I am going through the expressions section of the manual and having an issue with my code, am I missing some important part of the expression here?
return
if(YSplinePosition>0,3,
if(YSplinePosition<1,1,
if(YSplinePosition==0.5,2)));
Compile error. Wrong number of arguments in function: "if" at line 4:
if(YSplinePosition==0.5,2)));
^
What I am trying to achieve is:
Always have the bottom piece (Input 3) from 0 to 0.5
Always have the top piece from (Input 1) 1 to 0.5
Always use the mid piece (Input 2) at exactly 0.5
I modified it to include r (which I think was the missing variable: "r is the value that is output if the test returns false") However it still doesnt behave as I expect.
return
if(YSplinePosition>0,3,
if(YSplinePosition==0.5,2,1));
Evaluation: Ok
Edit:
This is the closest that comes to working however I want the middle piece (Input 2) to stay and the others to tile/scale vertically, if I adjust the height of Y the centre piece can dissapear:
return
if(YSplinePosition<0.49,3,
if(YSplinePosition>0.51,1,2));
Any help would be greatly appreciated thanks!