Spine Rotation Replicate with Prediction

Does anyone know how I could replicate a variable with client prediction. The variable is linked to an anim bp where it runs logic to make the players spine rotate up or down to mirror where the camera is pointing. AT first I just set it to replicated but when I turned on emulate network it made the game unplayable on everything except the server because the client had to wait for the server to return the value of the variable. After attempting to add client prediction the client can only see their own spine movement and no one else’s but the server can see every player’s spine rotation. Here’s the code in the blueprint:


Here it is in the animBP:

Client-side prediction is basically applying a locally determined state/value, then RPC the server to determine its own value, setting the replicated var and applying the result.

The other side of CSP is correction where you save the local value and send it to the server with the RPC. The server determines its own value and compares it against yours. If outside the margin of error it fires back a correction with its value. Otherwise you get an ack.

There’s an in-depth overview of CMC that covers client-side prediction and correction. It’s a good resource for wrapping your head around the principles of CSP.