ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Move layer to position of another random layer each second

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jarratt Moody
Move layer to position of another random layer each second
on Feb 8, 2018 at 6:55:20 pm
Last Edited By Jarratt Moody on Feb 8, 2018 at 6:55:47 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]'


Return to posts index

Dan Ebberts
Re: Move layer to position of another random layer each second
on Feb 8, 2018 at 7:18:59 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



Return to posts index

Jarratt Moody
Re: Move layer to position of another random layer each second
on Feb 8, 2018 at 8:16:27 pm

Surprise! Works perfectly. Thank you!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]