Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Random positioned layer without leaving the boundaries

  • Random positioned layer without leaving the boundaries

    Posted by Engendro Diaz on September 13, 2021 at 11:07 am

    I am using
    random([thisComp.width,thisComp.height])

    but it sometimes means that half the layers ends outside the comp. Is there a way to make the edges of the layer remain within the comp?

    Engendro Diaz replied 4 years, 8 months ago 3 Members · 5 Replies
  • 5 Replies
  • Engendro Diaz

    September 13, 2021 at 11:12 am

    In addition what should I add if I wanted multiple layers to also be positioned randomly but at a specific distance from each other or at least so the do not overlap?

  • Dan Ebberts

    September 13, 2021 at 4:02 pm

    Depending on the type of layer, this might work:

    [width,height]/2 + random([thisComp.width-width,thisComp.height-height])
  • Engendro Diaz

    September 13, 2021 at 4:39 pm

    The legend himself. Thank you so much Dan, it wasn’t working because it was a shape layer but I precomposed it and it worked perfectly.

    Do you think there would be a way of having a couple of those layers also not overlapping?

  • Fabrice Leconte

    September 13, 2021 at 8:09 pm
  • Engendro Diaz

    September 14, 2021 at 7:33 am

    Amazing, Thank you so much. This is like the 100th time you and Dan have saved my life.

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