• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Expression to stop wiggle at a time

Explorer ,
Dec 12, 2022 Dec 12, 2022

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
;

TOPICS
Expressions

Views

275

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 13, 2022 Dec 13, 2022

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]];
}

Votes

Translate

Translate
LEGEND ,
Dec 12, 2022 Dec 12, 2022

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 13, 2022 Dec 13, 2022

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 13, 2022 Dec 13, 2022

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]];
}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 13, 2022 Dec 13, 2022

Copy link to clipboard

Copied

LATEST

That has worked perfectly Dan,

Those cursed curly brackets! Thank you so much for your help, much appreciated.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines