Link a keyframe to a slider control and animate with whole numbers.
I want to have a slider control for an animation couting up a percentage, so from 0% through to whatever value set via the slider control. I'd like the text to display as:
Rating = X% (X being the value)
I've found some useful posts on here that have helped me get some of the way there, currently I have the expression:
if (numKeys > 1){
t1 = key(1).time;
t2 = key(2).time;
v1 = 0;
v2 = effect("Slider Control")("Slider");
linear(time,t1,t2,v1,v2);
}else value
For linking the second keyframe on my "Source Text" value to my slider control. This works but you get all kinds of decimal places and I'd like whole numbers only, so I then added the following to get rid of the decimal places and add a "%" to the end.
text:x=Math.floor(effect("Slider Control")("Slider"));x+" %"
But it removes the animation, the text now only displays the amount set on the slider control and not the animaion from 0 to it.
Also, adding:
"Rating = " +
at the front breaks the whole expression.
Any help with these issues would be much appreciated!