Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Move layer to position of another random layer each second

  • Move layer to position of another random layer each second

    Posted by Jarratt Moody on February 8, 2018 at 6:55 pm

    I’ve gotten this far and am getting a divide by zero error. I have 41 layers named “profile_bubble_#”. I am trying to move the z position of a Particular emitter randomly to one of those 41 layers each second. The transition needs to be immediate like a hold keyframe. Please save me Dan!

    seedRandom(Math.floor(time), timeless = true);
    layerNum1= Math.floor(random(1,41));
    'thisComp.layer("profile_bubble_' + layerNum1 + '").transform.position[2]'

    Jarratt Moody replied 8 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    February 8, 2018 at 7:18 pm

    Try it this way:

    seedRandom(Math.floor(time), timeless = true);
    layerNum1= Math.floor(random(1,42));
    thisComp.layer(“profile_bubble_” + layerNum1).transform.position[2]

    Dan

  • Jarratt Moody

    February 8, 2018 at 8:16 pm

    Surprise! Works perfectly. Thank you!

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