ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Convert increasing variable to looping variable

COW Forums : Adobe After Effects

FAQ   •   VIEW ALL   •   ADD A NEW POST   •   PRINT
Respond to this post   •   Return to posts index   •   Read entire thread


Mike Foran
Convert increasing variable to looping variable
on Jan 11, 2019 at 7:14:55 pm

I'm trying to write an expression that converts a constantly increasing variable, like time, to a looping variable. Kind of like the 'linear' function but instead of clamping the value translation to either end of the range, it would loop the variable back around to the beginning again. I've written this looping expression, but it doesn't really allow me to set the range of output values, it just cycles the variable every 10 seconds from 0 to 10. I also feel like there's a better way to do this that I am not aware of.

t = time;
t = time;
v = t;
i = 0;
End = 10
if (t>End){
i = Math.floor(t/End);
v = t - (i*End);
}

[v];


Posts IndexRead Thread 


Current Message Thread:





© 2019 CreativeCOW.net All Rights Reserved
[TOP]