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 amI 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 amIn 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 pmDepending 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 pmThe 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?
-
Engendro Diaz
September 14, 2021 at 7:33 amAmazing, Thank you so much. This is like the 100th time you and Dan have saved my life.
Reply to this Discussion! Login or Sign Up