I’m working on a camera function in c++. I want to point the camera on component of my pawn (it’s not exactly main mesh location). So I just need to find rotation between two actors.
FindLookAtRotation was promising but I found strange jitter occurring during movement with high speed. The problem is depending on frame rate. In 120 fps jitter is almost unheeded, in 30 there’s a mess. This may by related with whole time physics simulation on pawn, so values for interpolation may become unstable during movement. I hope you can understand me
Here’s what i’m talking about. I’m looking for some alternative calculations to set rotation on pawns componenent.
CameraCurrentLocation = Camera->GetComponentLocation();
CameraTargetLocation.X = ConeSpringArm->GetComponentLocation().X + 800;
CameraTargetLocation.Y = FMath::InterpEaseIn(CameraTargetLocation.Y, ZoneSet.Y, DeltaTime, 1);
CameraTargetLocation.Z = FMath::InterpEaseIn(CameraTargetLocation.Z, ZoneSet.Z, DeltaTime, 1);
FRotator CameraRotation = FindLookAtRotation(CameraCurrentLocation, CameraTargetLocation);
Camera->SetWorldRotation(CameraRotation);