30 Fps match to 120 fps

Hi.i hope you had a great day.

there is any way can match low fps with high fps totally?

I know I must use FrameRelatedVriable * DeltaTime but in the best case scenario, there is 2 % or 3% difference.

outer line is 30 fps, and the inner is 120.

SetActorRelativeLocation(GetActorLocation() + GetActorForwardVector()*(Speed * DeltaTime));

FRotator TargetRotation =  (-GetActorLocation().GetSafeNormal() - -TargetLocation.GetSafeNormal()).Rotation() ;

    TargetRotation =FMath::RInterpTo(GetActorRotation(), TargetRotation, DeltaTime, 2);
    SetActorRelativeRotation(TargetRotation);
    
    	if (GetWorld()->GetTimeSeconds() - DestroyTimer >DestroyTime) { Destroy(); }
    
    	DrawDebugLine(GetWorld(), GetActorLocation(), GetActorLocation() +( GetActorForwardVector()* 70), FColor::Red, true, 50, 0, 40);

Thanks.

anyone? any help appreciated

The problem is that your algorithm only accounts for translations-over-time, and not rotations-over-time.
During your 30fps run you only make one angular correction for every four angular corrections made during the120fps run. At frame zero the rotation and position are aligned. At frame 1 of the 120fps run the two paths are still perfectly aligned, but this is where the paths begin to diverge. The forward path is rotated, but the 30fps path maintains the same trajectory. Step forward to frame 2 of the 120fps run and the paths diverge even further, then again on the third. Finally, on the fourth frame at 120fps, and the FIRST frame change at 30fps the trajectory of both paths is rotated. Now the two paths are probably along parallel vectors, but their positions are different. As the frames continue and the paths curve they will sometimes diverge and sometimes converge, but they’ll rarely align perfectly.

What you need to do is apply the distance traveled along-a-curve, rather than in a straight line.

But even then, if you are updating the shape of the travel path (e.g. by steering) every frame then the curves defined at 120fps and at 30fps will not be identical. In this case, you would have to modify the travel vectors at the same rate regardless of drawing fps. You can either make the faster frame rates skip updates, or make slower frame rates perform multiple updates per frame.

The second option is, basically, physics sub-stepping.

i fix the problem with writing this simple code :

auto DeltaFix = (120) / (1 / DeltaTime);
ExtraFracSave = FMath::Frac(DeltaFix)+ExtraFracSave;

DeltaFix = FMath::FloorToInt(DeltaFix);

if (ExtraFracSave >= 1)
{
	ExtraFracSave = FMath::Frac(ExtraFracSave);
	DeltaFix++;

}

for (int i = 0; i < DeltaFix; i++)
{

    }

Thanks, GigasightMedia.