fixed: 重置摄像头旋转的时候也重置控制器

This commit is contained in:
meishibiezb
2026-03-17 11:54:41 +08:00
parent 0592cb2c04
commit e57ac424ff

View File

@@ -45,6 +45,13 @@ void ACameraPawn::CameraReset(const FInputActionValue& Value)
SpringArmComponent->TargetArmLength = InitialArmLength; SpringArmComponent->TargetArmLength = InitialArmLength;
SetActorRotation(InitialRotation); SetActorRotation(InitialRotation);
SetActorRelativeLocation(FVector::ZeroVector); SetActorRelativeLocation(FVector::ZeroVector);
// 同时旋转控制器
auto c = Cast<APlayerController>(FollowTarget->GetController());
if (c)
{
c->SetControlRotation(GetActorRotation());
}
} }
// Sets default values // Sets default values