Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Adding random positioning values

  • Adding random positioning values

    Posted by Paul Smith on September 24, 2014 at 4:57 pm

    Hi all,

    I’m new to expressions and have multiple layers which I’d like to randomly position

    I’ve tried this expression:

    seedRandom(index
    ,true);
    x = random(0,2000);
    y = random(0,1500);
    z = random(0,1500);
    [x,value[1],z]

    … but it doesn’t seem to do anything except move a layer to a position within the canvas and keep it there. I’d just like these layers to ‘pop’ from one position within the canvas to another

    Any help’s greatly appreciated!

    Dan Ebberts replied 11 years, 8 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    September 24, 2014 at 5:22 pm

    If you remove the seedRandom(index,true) line, you’ll get a new position each frame.

    Dan

  • Paul Smith

    September 24, 2014 at 5:41 pm

    Thanks Dan!

    And what if I wanted the position to hold for 3 or 4 frames…? And then move to a different position…

  • Dan Ebberts

    September 24, 2014 at 5:47 pm

    Then you have to put seedRandom() back in, but do something like this:

    holdFrames = 4;
    seed = Math.floor(timeToFrames(time)/holdFrames);
    seedRandom(seed,true);
    random([0,0,0],[2000,1500,1500]);

    Dan

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