BLACK FRIDAY EARLY BIRD United States Sale! Dec 8th Only! Save 50% Sitewide!
Special Offer Buy Every Package for $8412 $149
You save $8263 (99% off)

Fix Loop Bug in After Effects

Recently I discovered a nasty bug when looping time remap. I’ll try to explain it on the screenshot below.


The result is we lost 2 frames of animations. When precision matters, it sucks.

The main point is if you think there is something wrong with your time remap loop try the expression below instead of default loopOut.

// start - first keyframe
timeStart = thisProperty.key(1).time; 
// count duration
duration = thisProperty.key(thisProperty.numKeys).time + thisComp.frameDuration - timeStart ; 
// cycle number
quant = Math.floor((time - timeStart) / duration); 
if (quant < 0) quant = 0 // != 0
if (((time - timeStart) / duration).toString() == Math.floor((time + thisComp.frameDuration - timeStart) / duration)) {
  t = timeStart;
} else {
  t = time - quant * duration;  


You can also change the variable pingPong to true if you need a pingpong animation instead.

I spent 2 days only figuring out what was the problem, hope it helps someone.

Let me know in the comments if it did the trick for you.


Welcome to AEJuice Points
Become a member
With more ways to unlock exciting perks, this is your all access pass to exclusive rewards.
Already have an account? Sign in
AEJuice Points
Earn more AEJuice Points for different actions, and turn those points into awesome rewards!
Give your friends a reward and claim your own when they make a purchase.
They get
$15 off discount
You get
$15 off discount
AEJuice Points
Share on Facebook
3 Points
Like on Facebook
1 Point
Follow on Instagram
1 Point
Place an order
3 points for every $100 spent
Celebrate a birthday
2 Points
Ways to spend
Use at checkout
1 Point = $1
Use your points at checkout with any purchase. Points will not expire.