Personally I wouldn’t even bother using a slider, if that’s all you want to use it for. I’d just copy and paste this into your source text and adapt.
tStart = inPoint;
startCount = 0;
endCount = 3000000;
countDur = 14;
t = Math.max(time-tStart,0);
Math.round(linear(t,0,countDur,startCount,endCount))
stolen from Dan Ebberts
To adapt I’d create two additional text layers I’ve called them “End Count” and “Max Duration” to match Dan’s work and added a few safety features.
tStart = inPoint;
startCount = 0;
endCount = parseFloat(thisComp.layer(“End Count”).text.sourceText);
if (isNaN(endCount)) endCount = “0”;
countDur = parseFloat(thisComp.layer(“Max Duration”).text.sourceText);
if (isNaN(countDur)) countDur = “0”;
t = Math.max(time-tStart,0);
Math.round(linear(t,0,countDur,startCount,endCount))
I’ve just added that if the person you are giving this to enters words or nothing, it’ll default to zero.
Then in Essential Graphics, you can put the source text for these two layers into it instead and they just have to type the number in for Max Number and how long they want it to be…(There’s no way to extend the comp, so remind them what the max length is. Or again you can add a default, so if they go above that number it’ll only go as big as the comp).
Just because it took 2 secs, the below expression. I’ve added that feature as well (highlighted in black). Just change 20 to the max length so they can’t go above it, but they can go less if they ever need to.
tStart = inPoint;
startCount = 0;
endCount = parseFloat(thisComp.layer(“End Count”).text.sourceText);
if (isNaN(endCount)) endCount = “0”;
countDur = parseFloat(thisComp.layer(“Max Duration”).text.sourceText);
if (isNaN(countDur)) countDur = “0”;
if (countDur > 20) countDur = “20”;
t = Math.max(time-tStart,0);
Math.round(linear(t,0,countDur,startCount,endCount))
Hope this is of use to you