-
overiding an expression after x secs
Hi,
I’ve used some of Dan Ebbert’s great resources on Motion Script.com, and have an expression to randomly move an object along it’s Y axis. I’d like to have the randomness stop after say 4 sec’s and have the layer move to it’s fixed position. Is there a way to override the expression without using separate layers?
Here is the expression I used.Mike
segMin = .3; //minimum segment duration
segMax = .3; //maximum segment duration
minVal = -500;
maxVal = 200;end =0;
j = 0;
while ( time >= end){
j += 1;
seedRandom(j,true);
start = end;
end += random(segMin,segMax);
}
endVal = random(minVal,maxVal);
seedRandom(j-1,true);
dummy=random(); //this is a throw-away value
startVal = random(minVal,maxVal);
x = position[0];
ease(time,start,end,[x,startVal],[x,endVal])