camera jitter problem when following an object

Hi,

I am currently using Cesium inside Unreal Engine 5.6.1 in C++.

Now I have a weird problem I’m struggling with. I have an aircraft object that is flying pretty smoothly in the scene.

When looking at it from “Manual” mode I can see it flying smoothly. However, when I switch the camera to “Follow” mode which is always focused on the object, I saw the object have a small jitter relative to the camera. I don’t understand why there is this jitter, since in this mode the camera should be perfectly locked in the object. so Even if the object itself slightly jitters, I should not be able to see any jitter.

Now I suspect maybe my camera is lagging one frame behind the object or something like this, but this is only speculation.

I would love to hear what you think ? any ideas how to solve this annoying problem ?

Thanks a lot

This is my “Follow” mode code I use :

else if (ViewMode == EViewMode::SelectedCenter && TargetEntity)

{

FVector Geo = Georeference->TransformUnrealPositionToLongitudeLatitudeHeight(TargetEntity->GetActorLocation());

Georeference->SetOriginLongitudeLatitudeHeight(Geo);

RollDeg = 0;

m_dMinZoomDist = 5.0;

m_dMaxZoomDist =1500.0;

}

FRotator CamRot(PitchDeg, AzimuthDeg, RollDeg);

FVector Offset = -CamRot.Vector() * (DistMeters * 100.0); // cm

Pawn->SetActorLocation(Offset);

PC->SetControlRotation(CamRot);