-
Start wiggle at timepoint X without jumping
Hi there
I want to start a wiggle animation at a specific timepoint for a layer’s position.
I am currently using this code
maxFreq = 3;
freq = 0;if (time < 2.8) {
freq = 0; // 0 wiggles per second
} else {
if (freq < maxFreq) {
freq = freq + 0.05; // wiggles per second
}
}amp = 25; // px units applied for wiggle
loopTime = 10;
t = time % loopTime; // % returns remainder - resets every looptime to 0
wiggle1 = wiggle(freq, amp, 1, 0.5, t);
wiggle2 = wiggle(freq, amp, 1, 0.5, t - loopTime);
w = linear(t, 0, loopTime, wiggle1, wiggle2);
[w[0], w[1]]This code will start my wiggeling after 2.8s. But unfortunately I can see the position jumping in the beginning. I thought I could improve it by slowly increasing the freq variable, but obviously it would not work. Any idea how I could get this to work?
Thanks