Synchronized camera animations

Hello,

I have two camera animations that run synchronously on position and target:

https://www.babylonjs-playground.com/#0NTY5C#2

Why does the animation on target lag noticeably behind the animation on position?
Is there any way to work around this?

Thanks for any help.

Welcome aboard!

I think you want to use clone() on the parameters you used in your animation keys, else you will get weird effects because camera.position and camera.target are the properties modified by the animation:

https://www.babylonjs-playground.com/#0NTY5C#3

Thanks. This solves the problem of synchronization.

So does this mean that the frame calculation for the position takes updated position values as the camera moves while the frame calculation for the target takes the original value as if it was cloned?

No, it’s the same thing for both the position and target, but for some reasons it does work for the target without cloning it…