ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Random animation with pause/hold time

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Sumesh Surendran
Random animation with pause/hold time
on Dec 9, 2019 at 10:54:42 am

Hi,

I want to create random animation between 2 specific value with a pause/hold time of 1 second in between the movements.

I got this expression online which works for random animation, how can add 1 second pause/hold time in this expression.

segDur = 1;
minVal = 0;
maxVal = 140;
seed = Math.floor(time/segDur);
segStart = seed*segDur;
seedRandom(seed,true);
startVal = random(minVal,maxVal);
seedRandom(seed+1,true);
endVal = random(minVal,maxVal);
ease(time,segStart,segStart + segDur, startVal, endVal);

Thank you.


Return to posts index

Dan Ebberts
Re: Random animation with pause/hold time
on Dec 9, 2019 at 5:10:55 pm

This should work:

segDur = 1;
holdDur = 1;
totalDur = segDur+holdDur;
minVal = 0;
maxVal = 140;
seed = Math.floor(time/(totalDur));
segStart = seed*(totalDur);
seedRandom(seed,true);
startVal = random(minVal,maxVal);
seedRandom(seed+1,true);
endVal = random(minVal,maxVal);
ease(time,segStart,segStart + segDur, startVal, endVal);


Dan



Return to posts index

Sumesh Surendran
Re: Random animation with pause/hold time
on Dec 10, 2019 at 8:31:14 am

It works perfectly.

Thank you Sir.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]