-
Changing speed of time based value
Hi again!
I have this expression
life = 5;
offset = 0;
SeedRandom(index,true);
pause = random(life+offset);
if(time < pause)
age = 0;
else
age = (time-pause) % life;The variable \\\”age\\\” pauses at 0, increases, resets back to 0 when it reaches the life value and repeats the same thing again.
As you can see, this is a time based expression and although the value keeps increasing, the speed is constant after the pause. I want to control the speed within the expression so it will gradually slows down as the value increases and the speed will reset and repeat as the value loops back.
However, I cannot get the speed to gradually stop. Subtracting time does not work as the speed stays constant and only slow it down altogether. The linear method only allows me to change the speed but not gradually.
Is there a way to gradually change it and if so, how?
Thanks in advance!