diff --git a/Source/lonese/MyCharacter.cpp b/Source/lonese/MyCharacter.cpp index 2c27764..e12900d 100644 --- a/Source/lonese/MyCharacter.cpp +++ b/Source/lonese/MyCharacter.cpp @@ -22,8 +22,10 @@ void AMyCharacter::Move(const FInputActionValue& Value) // תÏò if (f2d.SizeSquared() > 0.01f) { - FRotator Rot = FRotator(0, FMath::Atan2(f2d.Y, f2d.X) * 180.0f / PI, 0); - SetActorRotation(Rot); + FRotator Rot = FVector(f2d.X, f2d.Y, 0).Rotation() + FRotator(0, GetControlRotation().Yaw, 0); + float InterpSpeed = 10.0f; + FRotator NewRotation = FMath::RInterpTo(GetActorRotation(), Rot, GetWorld()->GetDeltaSeconds(), InterpSpeed); + SetActorRotation(NewRotation); } }