fixed: 重置摄像头旋转的时候也重置控制器
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user