How do I save a Player's Direction?

Lets take the first and third person template characters for example. These characters use the Character movement component (CMC) to move the character. CMC utilizes client-side prediction to add responsiveness to the owning clients inputs. Client-side prediction in simplest terms is execution of movement input on the owning clients simulation, then on the server.

When you apply movement input (WASD) these inputs execute movement logic immediately locallyOn the owning simulation.

The command and result are stored in a SaveMove struct which is buffered. At the next ClientNetSendMoveDeltaTime the buffer is flushed and all those saved moves are sent to the server.

The server applies the moves to its simulation and sends the results to all other clients. It then compares those results against the results you sent. If they are close enough, the servers sends you an ACK to validate the move. Otherwise it sends you a correction… its results for the move. Velocity, location, rotation etc.


The server can apply corrections through CMC to all character states. Velocity, location, rotation custom vars etc. It can also Teleport the pawn at will (location), but the majority of rotation to pawn/camera, outside of a CMC correction, will be overridden by the clients current rotation.

For example if the server applies a rotation to the pawn not initiated through CMC it will only apply to the server. The client will not see the result. Owning clients only see corrections for the most part.

You can easily test this by having the server apply Set Control Rotation and/or set the capsule component rotation via timer.

Neither rotations will be applied to the client.

1 Like