-
Multiple IF statements syntax question
Can anyone help with some IF statement syntax? No errors are shown, but this just doesn’t seem to work, to control whether an object comes in from left, top, right or bottom based on a slider (1-4):
if (comp("ObjectControl").layer("Control").effect("Direction")("Slider")==1) {
horiz=3050}
if (comp("ObjectControl").layer("Control").effect("Direction")("Slider")==3) {
horiz=-3050}
if (comp("ObjectControl").layer("Control").effect("Direction")("Slider")==2) {
vert=2550}
if (comp("ObjectControl").layer("Control").effect("Direction")("Slider")==4) {
vert=-2550}
else{
horiz=0
vert=0
}[easeOut(time,inPoint,inPoint+1, value[0]+horiz, value[0]),ease(time,inPoint,inPoint+1,value[1]+vert,value[1])]
I’m sure it’s the IF statements, as using:
horiz=3050;
vert=2250;
[easeOut(time,inPoint,inPoint+1, value[0]+horiz, value[0]),ease(time,inPoint,inPoint+1,value[1]+vert,value[1])]achieves a result, albeit just one of the four I need.