Copy link to clipboard
Copied
Hey everyone. I am trying to parent several shapes to a null with a delay between them. So i wish to control several layers with only one null.
I asked in AE discord channel and someone helped me with this code
For this code, i have a null named Control with a slider control named Delay. I used this code on shape's position.
This code works but there is a kinda big problem. When i use the expression, my layer moves somewhere else and start to follow my null from that point. I create an example project to explain.
This is what happens when the expression disabled
And this is what happens when the expression enabled
I am not sure how can i fix this / is it possible to fix. I hope someone can help me : D
(or maybe another way that i can parent layers to a null with delay : )
Thank you for reading.
See if this works closer to what you want:
p = thisComp.layer("Control").transform.position;
delay = thisComp.layer("Control").effect("Delay")("Slider")/100;
delta = p.valueAtTime(time-delay) - p.valueAtTime(0);
value+delta;
Dan
Copy link to clipboard
Copied
See if this works closer to what you want:
p = thisComp.layer("Control").transform.position;
delay = thisComp.layer("Control").effect("Delay")("Slider")/100;
delta = p.valueAtTime(time-delay) - p.valueAtTime(0);
value+delta;
Dan
Copy link to clipboard
Copied
Hey Dan, that worked great : )
May i ask you about what did we wrong, what did you do to correct it?
ps. And one more small question, since slider only let me values 0-100, how can i use values more than 100?
Thank you : )
Copy link to clipboard
Copied
The trick is that you need to add to your follower layer's position, the amount that the control layer has moved since time zero.
For the slider, you can just right click on the value and select Edit Value, where you can enter numbers outside the slider's range, or even change the range.
Dan
Copy link to clipboard
Copied
Hey Dan, thank you very much for the help : D
Copy link to clipboard
Copied
Hey Dan Ebberts, been trying to work something similar out. One question, how do I modify the Delay slider to be the number of frames (to delay)? Is this correct?
p = thisComp.layer("Control").transform.position;
delay = thisComp.layer("Control").effect("Delay")("Slider")*thisComp.frameDuration*(index - 1);
delta = p.valueAtTime(time-delay) - p.valueAtTime(0);
value+delta;
Find more inspiration, events, and resources on the new Adobe Community
Explore Now