Copy link to clipboard
Copied
Hi ! I have a slider that controls the position of a layer.
I want my position to be at the value of the slider at the 19th second of my composition, and then to go to 0 at the 20th second.
Doyou know any expression that would allow me to say "At X moment, be X value, and at Y moment, be Y value" ?
Thanks in advance !
Copy link to clipboard
Copied
You can use time, inPoint - time to get the time a layer is visible, and valueAtTime to find the time of a keyframe or marker. To transition between two times you can use a linear, ease, easeIn, or easeOut method right from the Expression Language>Interpolation menu in the timeline.
This expression will use the value of the slider to set both X and Y values, start the change nine seconds after the layer starts and end with the position of the layer at 0,0 at ten seconds.
ctrl = thisComp.layer("Control").effect("Slider Control")("Slider");
t = inPoint - time;
tMin = 9; // time to start in seconds
tMax = 10; // time to end in seconds
value1 = ctrl.value;
value2 = 0;
v = ease(time, tMin, tMax, value1, value2)
[v, v]
I hope that makes sense.
If you want to change only one of the position values with the slider then you will have to break apart the array.
If you want the position value to start at the current position value, then animate to the position value of the slider, then move to zero then that's another problem but the solution is similar.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more