Copy link to clipboard
Copied
Hey, I'm still an absolute beginner regarding Ae.
I am trying to create an Count up from -2 to roughly 160. The thing is, I need to skip some numbers. How do I do that?
Thanks a lot!
Copy link to clipboard
Copied
The easiest way would be to use an expression on the source text property of a text layer. The math involved depends on how fast you want the counter to go up and which numbers you want to skip. For example if you used this expression you could convert time into frames, then divide the frames by the number of frames you wanted the number to stay the same, then multiply the result by 2. This would give you a count that was only even numbers -2, 0, 2, 4, 6, 8 and so on. You could then add an if statement to stop the count at 160.
Another option would be to apply Math.Round to the value of a slider and then animate the value of the slider. This will give you whole numbers. You could divide these whole numbers by 2 to give you even numbers or 4 or 3. Then to skip groups of numbers you could add some additional keyframes.
Please give us a detailed explanation of exactly what you are trying to do and we can probably quickly point you to an efficient solution.
Copy link to clipboard
Copied
Alright, the thing is I want to skip more or less random numbers. I want to skip 1, 2, 154 and some more.
Copy link to clipboard
Copied
How random is random? Without more info nobody can tell you much. There's a million ways to do this. Code is fluid and many different methods can produce similar results. That said, it seems to me you are overcomplicating this. Counting from -2 to 160 can easily be done using the Numbers effect and skipping any numbers would just be some more keyframes. Perhaps you might care to actually read the help and watch some basics tutorials....
Mylenium
Copy link to clipboard
Copied
If I had a bit more sleep I'd be able to make this more precise. Here is how I would approach the problem if I needed to do this often or make a bunch of adjustments in the timing. If it was a one time only problem I would probably just use the numbers effect or add some keyframes to source text.
I would add an empty text layer and then add an expression slider to that text layer. The goal here is to set the starting and ending values for your count using keyframes for the slider. To that you would want to add a random value that always increases. Because expressions do not remember what values were in the previous frame you'll have to add a Java accumulator to go back to the first frame of the layer and then add the accumulated random numbers based on time. When you get to your maximum number you need an if statement that stops the count. That's a bit complicated so let me just give you a step by step:
If you need different numbers you will have to match the last keyframe value of the Slider to the numbers in the if statement. If you want a bigger change in the random numbers you'll need to edit the (5) in the random method to a different number. As it exists now it add a random number between 0 and 5 to the value of the slider.
I hope this helps. As inelegant as it is it will give you a randomly increasing count up that you can time to your needs. Here's an animation preset that will do the job. Dropbox - Random Count Up with slider.ffx
Just save it to your Custom presets folder and then apply it to an empty text layer.
Copy link to clipboard
Copied
Thanks a lot for this!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now