Skip to content

Instantly share code, notes, and snippets.

@Saamstep
Created May 10, 2020 00:16
Show Gist options
  • Save Saamstep/cc55c9c6bb581999f2cd652a0e2b018b to your computer and use it in GitHub Desktop.
Save Saamstep/cc55c9c6bb581999f2cd652a0e2b018b to your computer and use it in GitHub Desktop.
After Effects Countdown timer script (by: tutvid)
rateofSpeed = 1;
clockStartTime = thisComp.layer("Timer Duration").effect("Duration")("Slider")*60;
function addZero(n) {
if(n<10) { return "0" + n } else { return n; }
}
function noZero(n) {
if(n > 0) { return n+":" } else { return "";}
}
clockTimeNumber = Math.floor(clockStartTime - rateofSpeed*time);
minutes = noZero(Math.floor(clockTimeNumber/60));
seconds = clockTimeNumber%60;
minutes+addZero(seconds);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment