RayCast is different Server vs Client!

Really, big thanks for the huuge answer. Thank you really really much.

I’ve tried performing the LineTrace on the client (as you suggested) as soon as the Fire() function is called (hence, as soon as the player clicks the left mouse button):



    FVector CameraLoc;
    FRotator CameraRot;
    Cast<APACharacter>(GetOwner())->GetActorEyesViewPoint(CameraLoc, CameraRot);

    FVector ShootDir = CameraRot.Vector();

    // trace from camera to check what's under crosshair
    const float ProjectileAdjustRange = Range;
    const FVector StartTrace = GetCameraDamageStartLocation(ShootDir);
    const FVector EndTrace = StartTrace + (ShootDir * ProjectileAdjustRange);
    TArray<AActor*> toIgnore;
    toIgnore.Add(Cast<APACharacter>(GetOwner()));

    ShowTrace(StartTrace, EndTrace, FColor::Red);


But the problem is exactly the same. The client’s line trace is visible and a bit off (like the screenshots above).

However, I kinda gave up to the idea of getting the exact same result for both the server and the client.

Your answer, though, was brilliant and will remain a future reference for me.