Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions How to create a Random Hold Time expression between Ping Pong effect?

  • How to create a Random Hold Time expression between Ping Pong effect?

    Posted by Kyle Balitz on February 22, 2019 at 4:20 am

    Hi does anyone know how to do a random hold time expression which I used a time remap ping pong effect? I want to the hold time to be random after the effect ping pongs?

    I was looking on the forum and something looked similar to this:

    if (numKeys > 1){
    minDelay = 1;
    maxDelay = 4;
    t1 = key(1).time;
    t2 = key(numKeys).time;
    if (time > t2){
    acc = t2;
    i = 1;
    while (acc <= time){
    seedRandom(i,true);
    delay = random(minDelay,maxDelay);
    prev = acc;
    acc += delay + (t2 - t1);
    i++;
    }
    if (time < prev + delay)
    valueAtTime(t2)
    else
    valueAtTime(t1 + time - (prev + delay));
    }else
    value;
    }else
    value

    Oleg Pirogov replied 7 years, 5 months ago 2 Members · 1 Reply
  • 1 Reply
  • Oleg Pirogov

    February 24, 2019 at 7:12 am

    So, what’s the problem with the code?
    If you animate one ping pong of yours with keyframes, the code seems to do exactly what you need.

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