Yep, nice catch — A local variable get reseted to its default value every tick. Making it static will make it work as if the variable was global, but retain its local scope.
Also, Zebbi, keep in mind this system is not framerate independent, I believed you should use wallclocktime instead of tickcount to increment animTick.
EDIT: Changed to global and it works! It was just the viewport layer was set wrong, I ALWAYS make this mistake!
Out curiosity, can you switch out tickcount for wallclocktime in just one expression? I believe I already have a variable for changing wallclocktimeold to wallclocktimecurrent if there's a difference, but doing it in one line would be much handier.