Client's rotation jittery, but only in the host's game

Character’s head rotation is working except that in the host’s window the client still jitters. (Everything looks good when controlling the host, and when controlling the client everything looks good in the client’s window, but when controlling the client the client’s character jitters in the host’s window… just not in its own window)

My character is mech-like, uses the controller’s desired rotation and orients rotation to movement. I then get a rotation using a line trace from the player’s camera to modify/transform the upper body in the anim BP.

I Update the animation before the switch because the host wasn’t doing anything. The rotation I set in “Update Animation Variables” following a line trace, and is not replicated. The rotation is retrieved thread safe in the anim BP.

There you see I’m doing the same thing for several other rotations, but if I get the “head rotation” working properly the rest should work as well.

You are running update animation variables on the server execution. You need to run it on the local client and then send the results to the server.

I think I’ve done what you said, but it has the same result. Also, you can see in the video that the rotation actually works fine when just aiming. But when I strafe, that’s when the jitter happens. However, it’s only the head that jitters. (Arms look strange because I am skipping calculating those variable until I fix the head jitter)

Anything that you expect to be used across clients needs to be set to replicate. Your Head Rotation var is not set to replicate. You should be replicating the rotation var in your character and then in your anim bp reach into the pawn owner to get anything. Anim BP’s are only local to the local client, they do not replicate.

I suggest reading through this to get a good overview of replication and networking, do’s and donts, etc. : Multiplayer Network Compendium | An Unreal Engine Blog by Cedric Neukirchen

That’s what I’d consider the holy grail of documentation for networking in Unreal

Replicating the rotation didn’t improve the jitter either. Admittedly, it has been quite a while since I read the compendium. Probably time for a refresher. I suspect the issue is actually related to my character rotation (I orient rotation to movement), since the jitter only occurs when i move the character, not when I aim. Digging into that now.

Update: When I disable orient rotation to movement the jitter goes away. However, I want rotation to follow movement.

Update: Reducing the character movement’s rotation rate significantly reduces jitter, but this isn’t ideal for the character’s animation.

1 Like

Installed the smooth sync plugin and that seems to have fixed it.

1 Like