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

Using "loopOut" With A Delay (and An External Variable)

Community Beginner ,
Aug 09, 2024 Aug 09, 2024

Hi there, folks!

 

I'm fairly inept with expressions, so I may be banging my head against a very thin wall here... but basically, I'd like to delay a looped animation (which currently uses "loopOut") by X number of frames, with X being defined by another layer.

 

At the moment, I have three layers:

 

- A precomposed animation of a typewriter arm striking a page

- A text layer

- A background

 

That second layer includes an expression which reveals characters at a random rate, resulting in an organic typewriter effect:

 

minRate = 3;
maxRate = 6;
charCount = 0;
t = 0;
seedRandom(index,true);
while (t < time){
   var RandomRate = random(minRate,maxRate)
   charCount++;
   t += framesToTime(RandomRate);
   }
value.substr(0,charCount)

 

What I'd really like to do is have "RandomRate" influence when the animation in the top layer plays, either by delaying each loop or adjusting its duration.

 

The ideal result would see each appearance of a "typed" character being accompanied by a matched instance of the aforementioned animation, such that said animation appears to be typing the letters onto the background.

 

Put simply, is there a way to have my "RandomRate" variable influence when or how the looped animation in my top layer players?

TOPICS
Expressions , How to , Scripting
711
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
LEGEND ,
Aug 10, 2024 Aug 10, 2024

No. You would need to completely change your approach and have to use valueAtTime() to create your own controllable looping and it all would need to run in a continuous loop because of this old stinker (see the section about the wiggle() function):

 

https://www.motionscript.com/articles/speed-control.html

 

It's all doable, but not the way you currently have set it up and of course it will require different and more complex code.

 

Mylenium

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 ,
Aug 10, 2024 Aug 10, 2024
LATEST

That's a shame, but not at all unexpected. As mentioned, I'm pretty inept at this sort of thing.

 

What would be the best way to achieve what I want? I'm happy to start again from scratch; I'd just like the result to be something that's easy to reuse (ideally as a MoGrT).

 

Here are my only real requirements:

 

1. Dynamic characters are revealed at a varying, randomized rate

2. A synchronized animation (and its associated audio) plays with each such revelation

3. Said animation does not play when the "typed" character is a space (although having an empty animation with an associated audio file would be great)

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