Activity › Forums › Adobe After Effects Expressions › Why doesn’t this simple if statement work correctly?
-
Why doesn’t this simple if statement work correctly?
Posted by Ryan Paterson on September 14, 2012 at 5:43 amapplied to the position of a layer-
thisY = value[1];
if (thisY < 0){
thisY = thisComp.height + this.height;
}
[value[0], thisY – time*250]Ryan Paterson replied 13 years, 8 months ago 4 Members · 5 Replies -
5 Replies
-
Xavier Gomez
September 14, 2012 at 10:21 amI just tried your expression and there is no error.
So it works but maybe not the way you intented it.
If you are trying to loop a linear motion from bottom to top it for sure cannot make it.You should tell what you actually want to do.
Xavier.
-
Kevin Camp
September 14, 2012 at 2:23 pmi seem to remember that a recent version of ae (maybe cs5.5 or 6) had an issue with the term ‘this’ in objects… i believe that it was adressed in an update, so make sure you have the latest update installed for your version of ae.
Kevin Camp
Senior Designer
KCPQ, KMYQ & KRCW -
Ryan Paterson
September 14, 2012 at 4:47 pmyes, trying to loop linear motion. what am I doing wrong?
-
Dan Ebberts
September 14, 2012 at 6:48 pmI’m not sure exactly what you’re after, but play around with this and see if it gets you closer:
y = (value[1] – time*250)%thisComp.height;
if (y < 0) y += thisComp.height;
[value[0],y]Dan
Reply to this Discussion! Login or Sign Up