Copy link to clipboard
Copied
Hi,
I'm new to expressions so I'm sure this is some syntax error that I can't see. I have something wiggling in the Y-scale only and want it to stop at a certain time but am going wrong somewhere:
timeToStop = 10;
if (time > timeToStop){
value;
}else{
[transform.scale[0], wiggle(1, 35)[1]]
Any help much appreciated,
Thanks
Frank
;
What you have should work, assuming you add the missing curly bracket at the end. However, it's not a very graceful end for the wiggle. If that's an issue, you could fade the amplitude from 35 to 0 as it approaches the stop time, like this:
timeToStop = 10;
fadeTime = .25;
if (time > timeToStop){
value;
}else{
amp = ease(time,timeToStop-fadeTime,timeToStop,30,0);
[transform.scale[0], wiggle(1, amp)[1]];
}
Copy link to clipboard
Copied
Wiggle is applied additively, so you can't stop it this way. You'd have to stop the wiggle parameters themselves. That said, if you realyl want a hard stop simply split the layer. No point in jumping hoops for something that simple.
Mylenium
Copy link to clipboard
Copied
Hi Mylenium,
Thanks for the reply. Here's the animation for a bit of context. My first thought was to split the layer but there's a lot of nulls attached to points and vice versa so I'd need to split every layer and redirect a lot of the expressions linking positions for the new layers. So I was hoping there would be an easier way to change the wiggle on the y scale of the products bar which is what's driving everything. I just need it the wiggle to drop out so that I can then keyframe a few things.
The expression above I have used for a parameter wiggle but it doesn't work here when I am only wiggling on the y-scale. I'm sorry, I don't really know what you mean by stop the wiggle parameters themselves. What might that look like in the expression above?
Thanks again for the help, much appreciated,
f
Copy link to clipboard
Copied
What you have should work, assuming you add the missing curly bracket at the end. However, it's not a very graceful end for the wiggle. If that's an issue, you could fade the amplitude from 35 to 0 as it approaches the stop time, like this:
timeToStop = 10;
fadeTime = .25;
if (time > timeToStop){
value;
}else{
amp = ease(time,timeToStop-fadeTime,timeToStop,30,0);
[transform.scale[0], wiggle(1, amp)[1]];
}
Copy link to clipboard
Copied
That has worked perfectly Dan,
Those cursed curly brackets! Thank you so much for your help, much appreciated.