Adding functions to expressions - source text not displaying
I am very new to after effects and writing expressions, however I do code in other languages so I have a basic understanding of code structure and I understand what After effects coding is trying to do when I read a sample.
My problem is that any expression containing a function call stops appearing on screen. The layer is still there, it's just not evaluating the function and thus the output is null and thus nothing is presented on screen.
If I remove the function declaration and the call to the function from the code, the remainder of the code executes without issue, so I can definitely say the issue is with functions in general or the specific code. I have copied and pasted code from verified working projects into my code, but still same result.
This makes me think the problem is at the system level. Is there a project setting that needs to be enabled for functions to work properly? Just updated AE to CC2019 (Version 16.0.0, build #235) I have not tried coding in AE before this version so cant specifically tag this to an upgrade...
Code I am specifically using for this (countdown timer). Problem is not isolated to this code. I can write simpler functions and none of them work either.
duration=thisComp.layer("InputDuration").effect("Slider Control")("Slider");
countdown = Math.floor(duration-time);
minutes = Math.floor(countdown/60);
seconds = countdown%60;
function addZero(n) {
if (n<10) return "0" + n else return n;
}
if(duration > 0 && time < duration){
"Time Remaining: " + minutes + ":" + addZero(seconds);
} else {"Time Remaining: 0:00"}
