The wiggle() function returns a modified version of what it is supplied. What this means is that if you have a layer at [360, 240, 200] and apply an expression that reads wiggle(1, 5) you will get results between [355, 235, 195] and [365, 245, 205].
In your earlier example you were multiplying the results of wiggle() directly. With our previous example and your expression you would get results between [355, 235, 975] and [365, 245, 1025], not only is that a difference of 50 on the Z-axis (5 * 5 should be a difference of 25) but it’s much much farther away on the Z-axis than it should be! What gives?
What you want to do is multiply the offset that the wiggle() is generating, not the result itself. In Dan’s expression wiggle(3,thisComp.layer("null").effect("Slider Control")("Slider")) - value; gives you the difference between the layer’s ‘normal’ position and it’s wiggled position (in the example we’ve been using this would be values between [5,5,5] and [0,0,0]).
You don’t want to use this offset directly in your result, instead you want to multiply the offset’s Z value by 5 (giving us [5,5,25]) and then add the original position back into this vector, again from Dan’s expression:
value + [w[0],w[1],w[2]*zMult]
The other thing to note about Dan’s expression is that he only used wiggle() once and assigned that value to a variable. This cleaner for the position property because wiggle() will give you a vector in the form of [x,y,z] when applied to the position property. Calling wiggle() three times will give you 3 different [x,y,z] vectors (9 total values of which you’re only using 3) and take (theoretically) three times as long to compute.
Darby Edelen
DVD Menu Artist
Left Coast Digital
Aptos, CA