View all expressions
Motion

Hanging Ornament Sway Animation

Generates a smooth, physics-based sine wave rotation that mimics an object dangling in a breeze. It automatically offsets the timing based on the layer index, ensuring a row of objects swings naturally rather than in robotic unison.

Contributed by:


freq = 1.5;
amp = 15;
decay = 0; // Set to 0.1 if you want it to stop eventually
// Offset phase by index so ornaments sway differently
offset = index * 10;
Math.sin((time + offset) * freq) * amp;

Hanging Ornament Sway Animation

Practical use case

Essential for animating hanging decorations, lanterns, signs suspended by chains, or any object that needs to react to simulated wind.

Check out similar expressions

Data-driven video workflows for After Effects are easier with Plainly.

a mesh of elegant lines transparent image