Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Random animation with pause/hold time

  • Random animation with pause/hold time

    Posted by Sumesh Surendran on December 9, 2019 at 10:54 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.

    Sumesh Surendran replied 6 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    December 9, 2019 at 5:10 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

  • Sumesh Surendran

    December 10, 2019 at 8:31 am

    It works perfectly.

    Thank you Sir.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy