Greetings,
Trying to set the rotation of a CameraComponent that is attached to a SpringArmComponent.
The idea is to rotate the Spring Arm around it’s pivot and have the camera component attached to it that will always face the Spring Arm pivot.
The spring arm rotation is working fine, but I see no effect when trying to set the rotation of the camera.
Any idea why I see no change in the camera rotation?
// The spring rotation, around itself
FRotator SpringRotation = CameraSpringArmComponent->GetComponentRotation();
SpringRotation.Pitch += Val;
// We need to rotate the spring arm along the Y axis
CameraSpringArmComponent->SetRelativeRotation(SpringRotation);
// Make the camera look at the spring pivot
FRotator CameraRotation = (CameraComponent->GetComponentLocation() - CameraSpringArmComponent->GetComponentLocation()).Rotation();
CameraComponent->SetRelativeRotation(CameraRotation);