Client's spingarm/camera rotation is not updating from server's viewport

So I launch projectiles in direction of my camera. However I noticed that client’s spring arm/camera only moves in its own viewport and is stuck in starting position from server’s viewport. How can I fix this(make server update client’s spring arm rotation)?

Server’s viewport(Camera should be lower as you can see in client’s viewport below):

Client’s Viewport:
image

Here’s all the code I use for replicating spring arm rotation:
Spring arm constructor

	// Create a camera boom...
	SpringArm = CreateDefaultSubobject<USpringArmComponent>(TEXT("SpringArm"));
	SpringArm->SetupAttachment(RootComponent);
	SpringArm->SetUsingAbsoluteRotation(true); 
	SpringArm->TargetArmLength = 400.f;
	SpringArm->SetRelativeRotation(SpringArmRotation);
	SpringArm->bDoCollisionTest = true;
	SpringArm->bEnableCameraLag = true;
	SpringArm->CameraLagSpeed = 8;
	SpringArm->CameraLagMaxDistance = 1.f;
	SpringArm->bEnableCameraRotationLag = true;
	SpringArm->CameraRotationLagSpeed = 8;
	SpringArm->CameraLagMaxTimeStep = 1;

ReplicatedProps:

void APlayerCharacter::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
	Super::GetLifetimeReplicatedProps(OutLifetimeProps);

	DOREPLIFETIME(APlayerCharacter, SpringArmRotation);
}

OnRep Function and spring arm update functions:

void APlayerCharacter::OnRep_SpringArmRotation()
{
	OnSpringArmRotationUpdate();
}

void APlayerCharacter::OnSpringArmRotationUpdate()
{

	SpringArm->SetWorldRotation(SpringArmRotation);

}

Set function for horizontal axis:

void APlayerCharacter::SetSpringArmRotation(float rotationValue)
{
	if (IsLocallyControlled())
	{
		
		SpringArmRotation = SpringArmRotation + FRotator(0, rotationValue, 0);
		OnSpringArmRotationUpdate();

		FString healthMessage = FString::Printf(TEXT("%s"), *SpringArmRotation.ToString());
		GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Blue, healthMessage);

		
	}

	if (GetLocalRole() == ROLE_Authority)
	{
		SpringArmRotation = SpringArmRotation + FRotator(0, rotationValue, 0);
		OnSpringArmRotationUpdate();

		FString healthMessage = FString::Printf(TEXT("%s"), *SpringArmRotation.ToString());
		GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Blue, healthMessage);
	}
}

Set function for vertical axis

void APlayerCharacter::SetSpringArmVerticalRotation(float rotationValue)
{
	if (IsLocallyControlled())
	{
		if(SpringArmRotation.Pitch + rotationValue<40 && SpringArmRotation.Pitch + rotationValue>-90)
		SpringArmRotation = SpringArmRotation + FRotator(rotationValue, 0, 0);
		OnSpringArmRotationUpdate();

	}

	if (GetLocalRole() == ROLE_Authority)
	{
		if(SpringArmRotation.Pitch + rotationValue<40 && SpringArmRotation.Pitch + rotationValue>-90)
		SpringArmRotation = SpringArmRotation + FRotator(rotationValue, 0, 0);
		OnSpringArmRotationUpdate();
	}
	
}

Input functions for horizontal and vertical rotations

void APlayerCharacter::RotateCameraVertical(float AxisValue)
{
	SetSpringArmVerticalRotation(AxisValue);
}

void APlayerCharacter::RotateCameraHorizontal(float AxisValue)
{
	SetSpringArmRotation(AxisValue);
}

Use Get Base Aim Rotation or Control Rotation.
If you need an accurate World Location for the camera on the server get it from the Camera Manager.

Controller (casted to class) → Camera Manager → Get Camera Location


Purple trace is server, Red is client

Without these results:
image

With Base Aim Rotation and CM->Get Camera Location

Hi, Rev0verDrive Thanks for the response.

I tried iterating through player controllers and casting to Cameramanager to get camera rotation but I got the same result. Would you mind sharing your C++ code/blueprints? And if it’s okay with you would you also mind showing your solution on example with another player?

I’m using the ThirdPerson template which uses Character Movement Component (CMC).
CMC auto replicates the Rot values needed for rotation control. Thus Base Aim and Control Rotation.