Copy link to clipboard
Copied
Hello,
I need to compare values between 2 consecutive frames (in this case the Y position). How do I get that value in the previous frame?
Once I have that it's just if-else from there on.
Copy link to clipboard
Copied
With a Google search I managed to put together this but it just gives me value 100 in every situation. VB is the variable for ValueBefore, VN means ValueNow...
VB = comp("Comp 1").layer("Red").transform.yPosition.valueAtTime(time - framesToTime(1));
VN = comp("Comp 1").layer("Red").transform.yPosition.valueAtTime;
if (VB <= VN) {T=0} else {T=100};
T
Copy link to clipboard
Copied
You were close:
VB = comp("Comp 1").layer("Red").transform.yPosition.valueAtTime(time - framesToTime(1));
VN = comp("Comp 1").layer("Red").transform.yPosition.valueAtTime(time);
if (VB <= VN) {T = 0} else {T = 100};
T
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more