Hey guys,
I have this in header:
(Struct is outside of class header, but in same .h file).
/* Struct representing a single moment's physics information for a Ship object,
including the time-stamp representing the time of calculation. */
USTRUCT()
struct FRemotePhysicsState
{
GENERATED_USTRUCT_BODY()
FRemotePhysicsState()
{
}
FRemotePhysicsState(FVector NewLocation, FRotator NewRotation,
FVector NewLinearVelocity, FVector NewAngularVelocity, float NewTimestamp)
: Location(NewLocation), Rotation(NewRotation),
LinearVelocity(NewLinearVelocity), AngularVelocity(NewAngularVelocity), Timestamp(NewTimestamp)
{
}
FVector Location;
FRotator Rotation;
FVector LinearVelocity;
FVector AngularVelocity;
float Timestamp;
};
////////////////////////////////////////////
// In class header:
/* Prepare local physics state for transmission via RPC. */
UFUNCTION(Category = Networking)
void TransmitLocalPhysicsState_Client();
/* Receive physics information from client about its physics state. */
UFUNCTION(Server, Reliable, WithValidation, Category = Networking)
void ReceiveLocalPhysicsState_Server(FRemotePhysicsState NewPhysicsState);
And these are those two functions:
void AShip::TransmitLocalPhysicsState_Client()
{
FRemotePhysicsState NewState(GetActorLocation(), GetActorRotation(), MeshComponent->GetPhysicsLinearVelocity(),
MeshComponent->GetPhysicsAngularVelocity(), 0 /* GET TIME */);
GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Yellow, NewState.Location.ToString());
GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Yellow, NewState.Rotation.ToString());
GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Yellow, NewState.LinearVelocity.ToString());
GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Yellow, NewState.AngularVelocity.ToString());
ReceiveLocalPhysicsState_Server(NewState);
}
void AShip::ReceiveLocalPhysicsState_Server_Implementation(FRemotePhysicsState NewPhysicsState)
{
GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Blue, NewPhysicsState.Location.ToString());
GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Blue, NewPhysicsState.Rotation.ToString());
GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Blue, NewPhysicsState.LinearVelocity.ToString());
GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Blue, NewPhysicsState.AngularVelocity.ToString());
SetActorLocation(NewPhysicsState.Location);
SetActorRotation(NewPhysicsState.Rotation);
MeshComponent->SetPhysicsLinearVelocity(NewPhysicsState.LinearVelocity);
MeshComponent->SetPhysicsAngularVelocity(NewPhysicsState.AngularVelocity);
}
bool AShip::ReceiveLocalPhysicsState_Server_Validate(FRemotePhysicsState NewPhysicsState)
{
return true;
}
When all of this is printed to the screen, it only happens once, as it very quickly gets set far from the world’s coordinates, and is instantly despawned.

The values are, from bottom to top - client position, client rotation (P = pitch, etc), client linear velocity, client angular velocity, then server-side position, rotation, and velocities.
Why is the server getting this insane value and pushing the object out of the map?
Thanks.