Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Animation Challenge

Community Beginner ,
Jul 31, 2024 Jul 31, 2024

I have a field of symbols of varying opacities and sizes (over 100). I need to animate all of them moving up and out of view at different speeds. I used null objects and animated them going from below the stage to above the stage and added a loopOut(type="continue") expression to the position property.

 

The problem is that the symbols leave the stage. Ideally, the symbols should cycle back from the bottom and to the top. I'm not sure how to get that to work. loopOut(type="cycle") does that, but the symbols appear back where they started.

 

Essentially, it should just be a continuous loop for every symbol. I was thinking a particle effect might help, but there are 2 symbols and they vary a bit. Any suggestions?

TOPICS
Expressions , How to
977
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advocate , Jul 31, 2024 Jul 31, 2024

Maybe something like this:

seedRandom(index, true);
dur = Math.random() * 3 + 1;
seedRandom(Math.floor(time / dur), true)
x = Math.random() * thisComp.width;
y = linear(time % dur, 0, dur, thisComp.height + sourceRectAtTime().height / 2, -sourceRectAtTime().height / 2);
[x, y]
Translate
Advocate ,
Jul 31, 2024 Jul 31, 2024

Maybe something like this:

seedRandom(index, true);
dur = Math.random() * 3 + 1;
seedRandom(Math.floor(time / dur), true)
x = Math.random() * thisComp.width;
y = linear(time % dur, 0, dur, thisComp.height + sourceRectAtTime().height / 2, -sourceRectAtTime().height / 2);
[x, y]
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 31, 2024 Jul 31, 2024

And that expression would go on the position property, right?

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jul 31, 2024 Jul 31, 2024

Yes, transform > position

you can adjust this line to control the random speed / duration

dur = Math.random() * 3 + 1;

Here, the shape layers take between 1 and 3 seconds to move across the screen.

  

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 31, 2024 Jul 31, 2024

Cool and what if I need the maximum duration to be 10 seconds?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jul 31, 2024 Jul 31, 2024
// between 1 & 10s 
dur = Math.random() * 10 + 1;

// between 2 & 10s 
dur = Math.random() * 9 + 2;

// between 3 & 10s 
dur = Math.random() * 8 + 3;
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 31, 2024 Jul 31, 2024
LATEST

Awesome! I'll try that.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines