Copy link to clipboard
Copied
Hi,
I am a complete newbie to AE expressions. I have 24 comps that I don't want them all to start to play at the same time, I would like them to start randomly, essentially randomly delay each comp by a few seconds. I don't want to stagger the comps as the project may grow and I would rather use an expression if possible.
I found the code below but I am getting an error. Can someone please advise me? Any help would be greatly appreciated.
//time remap
delay = 5;
framerate = 25;
n = name - 1;
d = n*(delay)/framerate;
t = thisLayer.timeRemap.valueAtTime(time-d);
[t]
Thank you so much for replying! I have added the code as per below but it doesn't seem to delay the comp playing in any way. Maybe I'm doing something esle wrong or maybe using the wrong approach?
//time remap
delay = 5;
framerate = 25;
n = Number(name.split(' ')[1]) - 1;
d = n*(delay)/framerate;
t = thisLayer.timeRemap.valueAtTime(time-d);
[t]
Copy link to clipboard
Copied
name is the layer’s name, so:
n = DAY 1 - 1;
can't return a number.
You must either rename your layer (1, 2, 3, 4, 5...)
or extract the number from the layer’s name.
n = Number(name.split(' ')[1]) - 1;
Copy link to clipboard
Copied
Thank you so much for replying! I have added the code as per below but it doesn't seem to delay the comp playing in any way. Maybe I'm doing something esle wrong or maybe using the wrong approach?
//time remap
delay = 5;
framerate = 25;
n = Number(name.split(' ')[1]) - 1;
d = n*(delay)/framerate;
t = thisLayer.timeRemap.valueAtTime(time-d);
[t]
Copy link to clipboard
Copied
delay = Number(name.split(' ')[1]) - 1;
time - delayShould be enough
Copy link to clipboard
Copied
Perfect, thank you so much for all your help!!!
Correct code is below for anyone else:
//time remap
delay = 2;
framerate = 25;
n = Number(name.split(' ')[1]) - 1;
d = n*(delay)/framerate;
t = thisLayer.timeRemap.valueAtTime(time - delay);
[t]
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more