Proper way to replicate character rotation and camera direction

I am making a multiplayer first person melee slasher and am brand new to working with multiplayer replication and also very new to UE. The view is done in “true first person” so it is a 3rd person game but with the players camera basically right in their chest.

My character blueprint is roughly based on the third person template character blue print.

In my game, depending on the situation. the player can turn their head independently from their body and their animations are adjusted by an aim offset. I have everything working nicely and animating properly in single player mode. However, in multiplayer, the other players body and head rotations do not replicate at all. My current code controls a players body rotation by setting the rotation on the “mesh” component, while the direction they are looking is controlled by setting the rotation on the camera boom. Neither of these rotations replicate in multiplayer. The aim offset is then calculated based on the differential between the mesh rotation and the camera boom rotation.

I think that UE5 automatically replicates character rotation nicely if you do it properly, but i don’t know what the best practice for what values I set to separately control where the player is looking and the actual rotation of the characters body. I need both of those to replicate properly so that other players can see both which way the players body is facing and also see what they are looking at via their aim offset. What is the best practice here? I’m using some C++ and some blueprints and am happy to solve the problem in either.

If I use the “controller rotation” that seems to spin both the players body and the camera with it which I don’t want, I only want the body to spin.

Thanks!

I figured it out, you need to set the camera spring arm to absolute rotation like this:

That way setting the controller rotation doesn’t effect the players camera. Then I just switched my code so that instead of setting the mesh rotation I set the controller rotation and left any code that rotated the camera unchanged. Everything works properly and replicates to other clients as expected.

Of course the aim offset has to be replicated separately.

This post helped, thanks to @Shrredder