Why is yaw rotation the only rotation replicating to remote pawns?

I have a round world so I updated the character movement component to allow for walking around on such. The characters feet always point towards the center of the world. To allow for this every tick if the character is moving I adjust their control rotation. This worked well in single player, but now that I’m setting this up for multiplayer I have to do this on the server. Upon doing so the server characters are all reporting the correct rotation. The clients only report their owned pawn rotation correctly (the pawn they are controlling), the remote pawns do not inherit the correct rotation from the server. Why is this?

I’m not making any progress on this. I call a server function to adjust the rotation and I can see on the server the rotations are correct. But only the yaw is correct on the clients. Somewhere there is something prohibiting the Roll and Pitch from replicating.

If I manually set the rotation on the remote pawns (perhaps this is what I’m supposed to do?) Then the rotation is fine, except that it twitches as if it’s being told to have the bad rotation, but the proper rotation that I’m manually setting is fixing it. This confuses me because if I’m supposed to set the rotation on the remote pawns after the server has updated the movement then I would expect the rotation was not touched by the server. So I believe that the server is actually updating the rotation, but it is only updating the yaw rotation, but still setting the rotation with inaccurate Roll and Pitch values that are not being replicated to the client.

Hi, I also struggled with this some time but have found the solution by checking the ShooterGame example. There is a function called GetBaseAimRotation() for Characters, never saw that one before. The ShooterGame example takes this value and transforms it into local rotation this way:

Header file:

	/** get aim offsets */
	UFUNCTION(BlueprintCallable, Category = "Game|Weapon")
	FRotator GetAimOffsets() const;

CCP:

FRotator AShooterCharacter::GetAimOffsets() const
{
	const FVector AimDirWS = GetBaseAimRotation().Vector();
	const FVector AimDirLS = ActorToWorld().InverseTransformVectorNoScale(AimDirWS);
	const FRotator AimRotLS = AimDirLS.Rotation();

	return AimRotLS;
}

You can also access this function in Blueprints since it’s marked as BlueprintCallable and use the return value to animate your Aim animations.

Greetings!

you very much sir, it worked perfectly for me! I should be looking more often at the sample projects :wink:

OMG . . i was also struggling with this problem for a day . . you so much Xetatronics thnku . . :slight_smile: