Client owned character rotates slower than (listen) server owned character

Hello everyone!
I have an issue with rotating character in multiplayer. The character owned by listen server rotates just as expected (on both server and clients) but for some reason the rotation of character owned by client is way too slow.

You can check video of the issue here

The function that I am using to rotate the character:

bool APlayerCharacter::DeltaRotatePlayerToDesiredYaw(float DesiredYaw, float DeltaTime, float RotationRate)
{
	float CurrentYaw = GetActorRotation().Yaw;

	bool Result = FMath::IsNearlyEqual(CurrentYaw, DesiredYaw, 0.1f);
	if (Result)
	{
		SetCharacterRotation(FRotator(0.f, DesiredYaw, 0.f));
		return true;
	}
	else
	{
		float YawDiff = FMath::FindDeltaAngleDegrees(CurrentYaw, DesiredYaw);
		float Multiplier = YawDiff / FMath::Abs(YawDiff);
		float RotateBy = Multiplier * RotationRate * DeltaTime;

		if (FMath::Abs(YawDiff) <= FMath::Abs(RotateBy) + 0.5f)
		{
			SetCharacterRotation(FRotator(0.f, DesiredYaw, 0.f));
			return true;
		}
		else
		{
			SetCharacterRotation(FRotator(0.f, CurrentYaw + RotateBy, 0.f));
			return false;
		}
		return false;
	}
}

where SetCharacterRotation is:

void ABaseCharacter::SetCharacterRotation(FRotator NewRotation)
{
	SetActorRotation(NewRotation);

	if (Role < ROLE_Authority)
	{
		Server_SetCharacterRotation(NewRotation);
	}
}

and Server_SetCharacterRotation is a server RPC that calls SetCharacterRotation again.

Any help in fixing this issue would be highly appreciated. Thanks!

Just from a quick glance it doesn’t seem like your SetCharacterRotation inside the nested if conditional takes DeltaTime into account. The SetCharacterRotation in the nested else condition does and I would assume any rotation operations should.

Just from a quick glance it doesn’t seem like your SetCharacterRotation inside the nested if conditional takes DeltaTime into account. The SetCharacterRotation in the nested else condition does and I would assume any rotation operations should.

I misunderstood your response and commented wrong earlier.
The SetCharacterRotation() inside if conditional doesn’t need to take DeltaTime into account.
The if conditional tests if the desired rotation and current rotation are almost nearly same. In that case, DeltaTime becomes irrelevant.
The conditional tests works on server owned character (for bother server and client), or in single player. No issue there. Something is messing the rotation of client owned characters and I am not sure what

Okay, so the reason this happens is because server resets the client’s rotation every 2 out of 3 frames for some reason (explanation here).

The solution for this is to call GetCharacterMovement()->FlushServerMoves(); before calling SetActorRotation().

Not sure if flushing server moves will cause other movement related issues but for now this seems to have solved the problem.