Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions random for 10 secs, then loop those numbers

  • random for 10 secs, then loop those numbers

    Posted by Bert Brown on January 4, 2010 at 1:58 am

    I’ve searched for looping random numbers, but nothing seems to be helping in what I’m looking for.

    How can I have a random number generated every second for 10 secs and then repeat the sequence until I change the seed (which would then repeat the new sequence)?

    All I seem to be able to do is have a second layer generating the random sequence and then using the attached expression, which isnt ideal.

    A = thisComp.layer("Cyan Solid 2").effect("Numbers")("Value/Offset/Random Max");
    T = time%10;
    A.valueAtTime(T)

    Dan Ebberts replied 16 years, 4 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    January 4, 2010 at 3:56 am

    Something like this will give a different random number (between 0 and 100) every second for ten seconds, then repeat. This will continue until you change the seed:

    seed = 113; // whatever you want here

    t = Math.floor(time%10);
    seedRandom(seed*10+t,true);
    x = random(100);

    Dan

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