Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Move object forward with constant distance but with random time segment.

  • Move object forward with constant distance but with random time segment.

    Posted by Mikhail Vasilev on January 15, 2016 at 7:46 am

    Hi there.

    I want to Move object forward with constant distance but with random time segment.

    For example
    It stays for 1 sec then move forward 10 pixels, then it stays for 0.5 sec and again moves for 10 pixels forward
    ………….
    I Tried Dan’s “accumulative rotation” expressions but it rotate with constant time segment.

    Mikhail Vasilev replied 10 years, 3 months ago 1 Member · 1 Reply
  • 1 Reply
  • Mikhail Vasilev

    January 15, 2016 at 7:57 am

    I’ve found some solution but now it works without ease )
    It jumps.

    segMin = .1; //minimum segment duration
    segMax = 1; //maximum segment duration
    minVal = [0, 10];
    maxVal = [0, 100];
    accum = 0; //initialize random accumulator

    end = 0;
    j = 0;
    while ( time >= end){
    accum += 15//random(10);
    j += thisComp.frameDuration;
    seedRandom(j,true);
    start = end;
    end += random(segMin,segMax);
    }
    endVal = random(minVal,maxVal)+accum;
    seedRandom(j-1,true);
    dummy=random(); //this is a throw-away value
    startVal = random(minVal,maxVal);
    ease(time,start,end,startVal,endVal)
    value+accum

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