Hello,
I using spring arm for my Third Person Camera and I need to realize LookAt instant function, it should wok with working player Input. I have a function which calculates rotation very precise but looks like PlayerController AddYawInput and AddPitchInput function changes somewhere input I send:
void AThirdPersonCameraManager::CameraLookAtTargetInstantly(AActor* actor)
{
if(actor == nullptr)
return;
ActorTarget = actor;
// here we can check if action player camera is on
// We have selected a new target. Compute desired rotation.
FVector cameraLocation = GetCameraLocation();
FVector targetLocation = actor->GetActorLocation();
FRotator cameraRotation = GetCameraRotation();
FRotator DesiredRotation = UCameraFunctionLibrary::CalculateLookAtRotation(cameraLocation, cameraRotation, targetLocation);
PCOwner->AddYawInput(DesiredRotation.Yaw / PCOwner->InputYawScale);
PCOwner->AddPitchInput(DesiredRotation.Pitch / PCOwner->InputPitchScale);
}
I have no active camera manager modifiers, so I don’t understand what’s wrong.
For example if I place AddYawInput(90.0f) - camera rotates only for 80+ degrees etc. Because of that I can’t calculate exact rotation speed to camera smooth move to look at.