ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Subtract 5 from a countdown and then subtract again after 5 seconds

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
David Adler
Subtract 5 from a countdown and then subtract again after 5 seconds
on Oct 22, 2017 at 3:12:44 am

I want to do a countdown that goes from 100 to 0. But it is not a normal countdown: after 10 frames it subtracts 5 and then, after another 10 frames, it subtracts 5 again. And the cycle repeats. I need an expression to do it for me because the client might want to change it. I'm using the "Numbers" effect from the "Text" section, applied to a solid to make the countdown.

What expression could I use to make it work?

Thanks!


Return to posts index

Dan Ebberts
Re: Subtract 5 from a countdown and then subtract again after 5 seconds
on Oct 22, 2017 at 6:25:08 am

Try this:

f = timeToFrames(time);
100 - Math.min(Math.floor(f/10)*5,100)


Dan



Return to posts index

David Adler
Re: Subtract 5 from a countdown and then subtract again after 5 seconds
on Oct 22, 2017 at 10:07:29 pm

Genius! It worked great.
Thank you very much.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]