feat: 旋转镜头同时旋转控制器
This commit is contained in:
@@ -17,8 +17,15 @@ void ACameraPawn::CameraZoom(const FInputActionValue& Value)
|
||||
void ACameraPawn::CameraRotate(const FInputActionValue& Value)
|
||||
{
|
||||
auto f = Value.Get<float>();
|
||||
FRotator r = FRotator(0.0f, f * RotateSpeed, 0.0f);
|
||||
FRotator r = FRotator(0.0f, -f * RotateSpeed, 0.0f);
|
||||
AddActorWorldRotation(r);
|
||||
|
||||
// 同时旋转控制器
|
||||
auto c = Cast<APlayerController>(FollowTarget->GetController());
|
||||
if (c)
|
||||
{
|
||||
c->SetControlRotation(GetActorRotation());
|
||||
}
|
||||
}
|
||||
|
||||
void ACameraPawn::CameraMove(const FInputActionValue& Value)
|
||||
|
||||
Reference in New Issue
Block a user