[BUG] Character Rotation Replication Issue

A “Server” function executes only on server. It is not replicated serve → other clients.

You have two options:

  • Create a UFUNCTION(NetMulticast) void BroadcastNewRotation(FRotator NewRot). BroadcastNewRotation_Implementation will do rotation. Call BroadcastNewRotation() from your ServerDoRotate() (NetMulticast functions can only be called by server). Note that NetMulticast functions also run on server itself, as well as all clients.

  • Create a FRotator MyRot that is RepNotify: UPROPERTY(ReplicatedUsing=OnRep_MyRot), add MyRot to GetLifetimeReplicatedProps() function, and create a OnRep_MyRot function that modifies rotation. See ShooterGame for examples – plenty of them there, for example, variable BurstCounter in AShooterWeapon.