Hello.
I am trying to implement client-side only world origin shifting. So, server always uses 0,0,0, but clients time to time sets origin to own location (to allow smooth animation and client-side bullets simulation).
So, to achive it, I use:
void AAbstractCharacter::PostNetReceive()
{
if (!GetWorld()->isServer()) {
ReplicatedMovement.Location.X = ReplicatedMovement.Location.X - GetWorld()->OriginLocation.X;
ReplicatedMovement.Location.Y = ReplicatedMovement.Location.Y - GetWorld()->OriginLocation.Y;
ReplicatedMovement.Location.Z = ReplicatedMovement.Location.Z - GetWorld()->OriginLocation.Z;
}
}
So, after world origin shifts on client - client starts to modify coordinates received from server by own world origin, so, visually all AAbstractCharacter objects keeps their position relativelty to static actor (like landscape). But except locally controlled AAbstractCharacter… PostNetReceive is not called for locally controller character - and I can’t find place where local player position are received from server…
So, how currently contolled Character position are received from server (to able to hook modify them on receive)?
UPDATE:
Was able to figure it out - Pull Request - World Origin Shifting in MP - Work in Progress - Unreal Engine Forums