Skip to main content
i_eat_karate
Participating Frequently
May 30, 2025
Answered

Go to and stop on a random frame?

  • May 30, 2025
  • 1 reply
  • 535 views

Is there a way to make a composition to go to a random frame and stop.

 

I want to have a grid of these random compositions in a larger main composition and each one will be stopped on a random frame. I'm going to place earch random composition into the grid manually, so there's no expression needed there. The random composition doesn't need to find out how many frames it has either if that makes it more complex, I'm fine entering that into the expression manually. 

 

This has to be easy but I'm not good at writing expressions and all of the expressions I've found stop or go to a random frame but not both and trying to combine them hasn't worked for me. 

Correct answer Dan Ebberts

You could try a time remapping expression like this:

maxTime = source.duration;
seedRandom(index,true);
Math.min(time,random(maxTime))

1 reply

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
May 30, 2025

You could try a time remapping expression like this:

maxTime = source.duration;
seedRandom(index,true);
Math.min(time,random(maxTime))
i_eat_karate
Participating Frequently
June 1, 2025

Thanks so much! It's working, it’s choosing a random frame for each of the compositions, but each composition always picks the same random frame. So the compositions are all in different frames, but they go to that same frame every time. I don’t know if that makes sense. I’ve attached it, if you have a minute to look at it. 

 

Also, if I delete one of the compositions from the grid or change the order of the layers then the others automatically randomize again. I don’t know if it’s helpful or not.

 

Thanks again for your help.

Dan Ebberts
Community Expert
Community Expert
June 2, 2025

Hmmm... I'm not sure I understand. What behavior were you hoping for?