캐릭터가 땅을 보면 W/S 키(전진/후진)가 작동하지 않음
방향전환이 너무 느려서 전투 시 불편함
1. 이동 방향 계산 문제:
컨트롤러의 Pitch(상하 각도) 때문에 카메라가 아래를 보면 이동 벡터가 잘못 계산됨
2. 회전 속도 부족:
RotationRate가 기본값(500)으로 설정되어 있어 민첩한 조작이 어려움
// 기존
GetCharacterMovement()->RotationRate = FRotator(0.f, 500.f, 0.f);
// 개선
GetCharacterMovement()->RotationRate = FRotator(0.f, 1200.f, 0.f); // 2.4배 향상
GetCharacterMovement()->bUseControllerDesiredRotation = false;
GetCharacterMovement()->AirControl = 0.8f; // 공중 조작감 개선
void ADCCharacter::Move(const FInputActionValue& Value)
{
const FVector2D Axis = Value.Get<FVector2D>();
if (Controller && (Axis.X != 0.0f || Axis.Y != 0.0f))
{
// 핵심: Pitch 무시, Yaw만 사용
const FRotator YawRotation = FRotator(0.f, Controller->GetControlRotation().Yaw, 0.f);
// 전진/후진 방향
const FVector ForwardDirection = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X);
// 좌우 방향
const FVector RightDirection = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::Y);
AddMovementInput(ForwardDirection, Axis.Y); // W/S
AddMovementInput(RightDirection, Axis.X); // A/D
}
}
Controller->GetControlRotation() 전체 사용FRotator(0.f, Yaw, 0.f) 로 수평면에서만 이동 계산bUseControllerDesiredRotation = false : 더 직관적인 회전 처리AirControl = 0.8f : 점프 중에도 방향 조절 가능