|
| Wiggle Between two values. Error in expression |
 |
Fri, 1 Feb 2008 15:33:08 -0800 |
I'm using this expression to wiggle my Y Position between two values. Well, to
wiggle a slider that is controlling the Y position in a layer.
freq = 2; // wiggles per second
amp = 100;
minWiggle = 25;
maxWiggle = 150;
w = wiggle(freq,amp)[2] - value[2];
value + [0, 0, linear(w, -amp, +amp, minWiggle, maxWiggle)]
But I'm getting an error:
"Class array has no property named 2."
|
| Post Reply
|
| Re: Wiggle Between two values. Error in expression |
 |
Sat, 2 Feb 2008 01:07:10 -0800 |
That expression will only work correctly on a three dimensional property such as
Position on a 3D layer. If you've applied it to a one dimensional property like
a Slider Control then that's why you're having problems. Here's a version of
that expression that works on a one dimensional property:
freq = 2; // wiggles per second
amp = 100;
minWiggle = 25;
maxWiggle = 150;
w = wiggle(freq,amp) - value;
value + linear(w, -amp, +amp, minWiggle, maxWiggle)
|
| Post Reply
|
| Re: Wiggle Between two values. Error in expression |
 |
Sat, 2 Feb 2008 11:23:18 -0800 |
|
| Post Reply
|
| Re: Wiggle Between two values. Error in expression |
 |
Mon, 4 Feb 2008 15:01:31 -0800 |
Hey Paul -- just a quick Q.
I plugged in your expression and it's not behaving as I'd expect. I thought it
would wiggle between min and max values. But it seems like it's *multiplying*
the original wiggle value by the min and max values.
|
| Post Reply
|
| Re: Wiggle Between two values. Error in expression |
 |
Mon, 4 Feb 2008 16:02:41 -0800 |
Hey don't ask me, it was your expression. I just made it work on your one
dimensional property.
It seems that changing the amp value has no effect. It's reused in the linear()
method, so I think it's cancelling itself out.
|
| Post Reply
|
|
|
|
|
|
|
|
|
|