Copy link to clipboard
Copied
Hi, I have a 3D object that I want to continuously bob up and down but I'm having trouble finding an expression to do this.
I would use wiggle on the Z except wiggle creates random motion and I need consistant up and down oscillations.
It seems simple but I can't figure it out... any ideas? Thanks.
-Pete
Copy link to clipboard
Copied
You might try something like this for Size or Scale (make sure the freq variable matches your other exrpession):
amp = 20;
freq = 1;
s = amp*Math.sin(time*freq*Math.PI*2);
value*(1+s/100)
Dan
Copy link to clipboard
Copied
Hey Dan,
Sorry in advance for bothering - I was wondering how I would go about adding a loop rule to this expression (i.e loop every 120 seconds).
Thank you!
Copy link to clipboard
Copied
Thank you, Dan! This is so simple yet effective.
Copy link to clipboard
Copied
Hey guys, sorry to revive this but the expression is really great. I'm trying to use it for the z-axis and so far it worked the only thing I'm stuck with is how to create only positive values for the amplitude. Any idea on how to do this?
Copy link to clipboard
Copied
Sorry for the late response.
One way to achieve this is by adding Math.abs() to your expression which will return the absolute values instead of true values (aka negative numbers get switched to positive).
Z=Math.abs(amp*Math.sin(time*freq*Math.PI*2));
- Eric
Copy link to clipboard
Copied
Hi all,
The expression worked great. But i have no idea on if it is possible to decelerate the "bobbing/bopping" motion.
Do i need to adjust the value or frequency?
Thanks guys! x
Copy link to clipboard
Copied
HOW CAN I STOP THIS?
Copy link to clipboard
Copied
Stop or start the effect by controlling amp and freq with sliders then animate the sliders.
Copy link to clipboard
Copied
If you get an error, try adding curly brackets to the if/else statement:
if (t < StartTime) {value;} else {(value + [x,0,0])}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now