Skip to main content
Oddlythinkn
Participating Frequently
August 15, 2018
Answered

How to scale object based on the direction of object that is using Wiggle on Position property

  • August 15, 2018
  • 2 replies
  • 789 views

I have a circle that is floating on the Y axis using the Wiggle expression.
I have a square which is linked to follow the circle.
I want to get the square to stretch as the circle goes up and squish as the circle goes down based on the wiggle expression.

This topic has been closed for replies.
Correct answer Kyle Hamrick

The linear expression function would be great here, but the easiest route is probably something like this:

Create slider control (under Expression Controls), and apply your original wiggle expression to that.

(While you're at it, you might as well make two. Name one "Freq" and the other "Amp")

Then just link your wiggles on the properties to those slider values. So, both the scale and Y-position expressions would look like:
wiggle(pickwhip to Freq, pickwhip to Amp)

You could also use multipliers if the scale ends up being too big of a change (which seems likely).

wiggle(pickwhip to Freq, pickwhip to Amp/10)
(or whatever math ends up looking right...)

2 replies

Kyle Hamrick
Community Expert
Kyle HamrickCommunity ExpertCorrect answer
Community Expert
August 15, 2018

The linear expression function would be great here, but the easiest route is probably something like this:

Create slider control (under Expression Controls), and apply your original wiggle expression to that.

(While you're at it, you might as well make two. Name one "Freq" and the other "Amp")

Then just link your wiggles on the properties to those slider values. So, both the scale and Y-position expressions would look like:
wiggle(pickwhip to Freq, pickwhip to Amp)

You could also use multipliers if the scale ends up being too big of a change (which seems likely).

wiggle(pickwhip to Freq, pickwhip to Amp/10)
(or whatever math ends up looking right...)

Kyle Hamrick
Community Expert
Community Expert
August 15, 2018

Additionally, since these are both properties that require arrays, you'll probably need to do a little extra work to isolate the wiggle to the single axis.

If you wanted only vertical scaling, for example, your expression would look like this:

w = wiggle(pickwhip to Freq, pickwhip to Amp);

[value[0],w[1]]

Mylenium
Legend
August 15, 2018

Simply re-use the wiggle with different values, but the same random seed. Ideally you would in fact apply the wiggle to a separate expression control and then pipe the values through linear() interpolators with the wiggle being the driver.

Mylenium