Looping animations is one of the first expressions you'll learn, and one you'll use constantly.
The magic expression:
loopOut("cycle")
That's it. Alt/Option-click the stopwatch on any property with keyframes, type that in, and it loops forever.
How to apply it:
1. Create your animation with keyframes (e.g., a bouncing ball: Position keyframe up, then down)
2. Alt/Option-click the stopwatch icon next to the property name
3. Type: loopOut("cycle")
4. Click outside the expression field or press Enter on the numpad
The 4 loop types:
- loopOut("cycle") — Repeats the keyframed animation exactly as-is. Most common.
- loopOut("pingpong") — Plays forward, then backward, then forward... Great for oscillating motion.
- loopOut("offset") — Each loop builds on the last value. If you animate 0→100, next loop goes 100→200, etc.
- loopOut("continue") — Continues the momentum of the last two keyframes infinitely.
loopOut vs loopIn:
- loopOut() — loops everything AFTER your last keyframe
- loopIn() — loops everything BEFORE your first keyframe
Loop a specific number of keyframes:
loopOut("cycle", 2)Common mistake: Applying the expression to a property that has no keyframes. You need at least 2 keyframes for the loop to work — it needs something to repeat.
Pro tip: Combine with time for continuous rotation:
rotation + loopOut("cycle")time * 90Want a personalized answer for your project?
Ask Oliver for Free →