Copy link to clipboard
Copied
I'm using version 16.1.3 and trying to execute a very simple expression I've used many times before.
I'm a wiggle expression to a layer then using hte expression pickwhip to attach it to a slider control on a separate solid so i can turn it on and off.
The final expression looks like this: wiggle(40,25)*thisComp.layer("Royal Blue Solid 3").effect("Slider Control")("Slider")
Problem is that when I set the slider (multiplier) value, in addition to multiplying the wiggle it's also affecting the world position of the layer.
This has never happened to me before although maybe it's been so long since I used this I forgot something or something has changed?
I tried several forms of the expression besides the one I posted including putting both sides of the equation in parenthesis and terminating it with a semicolon. I even tried scrapping the slider altogether and just testing "wiggle(40,25)*0" and the layer still moved to 0,0 world position.
Am I missing something? Thanks for your help.
Copy link to clipboard
Copied
This is completly expected.
You are effectivly turning your position to 0, not just the wiggle. Keep in mind that wiggle returns a value including your inital position, not just the wiggle-amount.
Instead of the multiplier, you can use the slider to control the wiggle amount. This way you can turn it off without loosing your inital position. wiggle(0,25) = inital position.
You can also read out your inital position and subtract it from the wiggle, add the striped wiggle and control it with the multiplier:
mypos = thisLayer.transform.position;
multi = thisComp.layer("Royal Blue Solid 3").effect("Slider Control")("Slider");
w = wiggle(40,25);
stripedw = w - mypos;
mywiggle = mypos + (stripew * multi);
*Martin
Copy link to clipboard
Copied
Thanks Martin. I could swear I use to just pickwhip it and it worked but I can't always trust my own brain 🙂
Copy link to clipboard
Copied
You use this simple expression
S=thisComp.layer("Royal Blue Solid 3").effect("Slider Control")("Slider");
wiggle(40*S,25*S);
-OussK
Copy link to clipboard
Copied
Thanks for that 🙂
~Paul