From 3b3873e889ebb729f0423501d1db2a4ee5d0e1f6 Mon Sep 17 00:00:00 2001 From: meishibiezb <750783119@qq.com> Date: Tue, 17 Mar 2026 11:40:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8A=A0=E5=85=A5=E4=BA=86=E5=8A=A8?= =?UTF-8?q?=E7=94=BB=E6=8F=92=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/lonese/MyCharacter.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); } }