Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Single random number on x axis

  • Single random number on x axis

    Posted by Criis Daw on June 5, 2015 at 11:01 am

    Hi all.

    i have hit a dead end and need your help.

    i am trying to place objects on a the x axis

    i want each objects position to be a little to the right of the one to the left of it.

    I have been using this expession

    thisComp.layer(index-1).transform.xPosition+50

    so each object is 50 pixels on from its neighbour. I like to use this expression as it allow my to change the order of the objects with out having to alter position information.

    Right but i would like to add some variation into it. rather than adding 50 I would like to add a value of between 20 and 50. And i can t for the life of my figure it out. Any help very much appreciated

    Thanks

    Criis Daw replied 10 years, 11 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    June 5, 2015 at 1:59 pm

    Try it this way:

    seedRandom(index,true);
    offset = random(20,50);
    thisComp.layer(index-1).transform.xPosition+offset

    Dan

  • Criis Daw

    June 5, 2015 at 2:03 pm

    oh you make it look so easy !

    thanks dan

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