So I let the client and server simulate physics, but at the end of the frame, I want the server to correct the client, (Since Pawn isn’t network enabled).
if (Role > ROLE_Authority)
{
ClientSmoothTransform(PhysicsBoxPrimitive->GetComponentLocation(), PhysicsBoxPrimitive->GetComponentRotation());
}
In my MyPawn.CPP
void AMyPawn::ClientSmoothTransform(FVector location, FRotator rotation)
{
//the server will give the owning client the severs pawn location and rotation
PhysicsBoxPrimitive->SetWorldLocationAndRotation(location, rotation);
}
I checked the RPC on the UE4 web page, but they do not show how to implement CLIENT RPC calls.
Just to be clear
UFUNCTION(Client) means - run on the owning client ? So the client who owns the Pawn on the Server?