I have created a simple rotation blueprint which should rotate a character. This is simple enough however it seems to fail when doing it in multiplayer. I have set up the character to rotate when a key is pressed, however, the character on the server always rotates correctly and displays correctly on the client. But the character on the client will only “sometimes” rotate, if I click the button a few times it does work as intended. I have no idea what going on here.
If pawn is directly controlled by camera, then it is bound to controller’s ControlRotation and the client has authority over it, so rotating on server will yield bad results.
Just rotate yourself on client-side and the server will follow.
Also you are getting player pawn via GetPlayerPawn(0), but you are already in the pawn (character) blueprint. Just use Self.
So the result should be much simpler, something like:
LeftShift → GetController → SetControlRotation (NewRotation)
If you are using Character Movement Component (CMC) then the initial movement has to happen on the client.
CMC uses client-side prediction. Thus server movement of pawns is deterministic and corrective.
