Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Random movement in a single direction.

  • Random movement in a single direction.

    Posted by Colby Turybury on July 25, 2017 at 2:48 pm

    I have a block of text that I need to move upward but I want the movement to be random. Go up 20 pixels here 50 pixels there 5 again. Something like that. however the trick is to get it to never go back go to a new spot then stop for a random number of frames.

    Colby Turybury replied 8 years, 9 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    July 25, 2017 at 6:32 pm

    Something like this maybe:


    minDist = 5;
    maxDist = 50;
    minHold = 5; // frames
    maxHold = 15;
    seedRandom(index,true);

    t0 = 0;
    t1 = 0;
    yTot = 0;

    while (t1 < time){
    t0 = t1;
    t1 += random(framesToTime(minHold),framesToTime(maxHold));
    if (t1 < time)
    yTot += random(minDist,maxDist);
    }
    value - [0,yTot]

    Dan

  • Colby Turybury

    July 26, 2017 at 2:59 pm

    This awesome!!! Thank you so much. I see that the block of text “steps” upward. How would you randomly make it move and smoothly and step upward? Could you also comment the script? I am a noob and am really needing to understand scripting.

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