Question 1:
- Create some actor or pawn or character with bReplicate = true
- Add function like “SetCameraRotation” to that actor with “Server” option
- Add function body “SetCameraRotation_Implementation” with code
When client call “SetCameraRotation” with FVector param - UE call “SetCameraRotation_Implementation” on server with same param inside server version of actor.
Example:
Header:
UFUNCTION(Server, Reliable, WithValidation)
void SERVER_Fire();
bool SERVER_Fire_Validate();
void SERVER_Fire_Implementation();
UFUNCTION(NetMulticast, Reliable)
void MULTICAST_Fire();
void MULTICAST_Fire_Implementation();
CPP:
bool ASomePawn::SERVER_Fire_Validate(){ return true; }
void ASomePawn::SERVER_Fire_Implementation()
{
MULTICAST_Fire();
}
void ASomePawn::MULTICAST_Fire_Implementation()
{
..Some code..
}
Client1 call SERVER_Fire → SERVER_Fire_Implementation called on server and it call MULTICAST_Fire → all client call MULTICAST_Fire_Implementation.
So that way client can call function on all client and server with any param you want.