From 71c2b2b028557af55f9b4b53d3efdbfdd8aff7dd Mon Sep 17 00:00:00 2001 From: 10000Je Date: Thu, 24 Apr 2025 01:56:23 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=B4=EB=8F=99=20=EC=86=8D=EB=8F=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content/Maps/Main.umap | 4 ++-- Source/ToonTanks/Tank.cpp | 4 +++- Source/ToonTanks/Tank.h | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Content/Maps/Main.umap b/Content/Maps/Main.umap index e046a26..690eaef 100644 --- a/Content/Maps/Main.umap +++ b/Content/Maps/Main.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0fcd36633b5117d30e6052d8cdf9f69038e463b42860a1c07da446fcbec0fc4c -size 95077 +oid sha256:be4b434f627c8aff0bec1a02b63347d9f731a60b7096b25015d72bf9a9c6c25a +size 95150 diff --git a/Source/ToonTanks/Tank.cpp b/Source/ToonTanks/Tank.cpp index 66bf574..7eb3018 100644 --- a/Source/ToonTanks/Tank.cpp +++ b/Source/ToonTanks/Tank.cpp @@ -5,6 +5,7 @@ #include "Camera/CameraComponent.h" #include "GameFramework/SpringArmComponent.h" +#include "Kismet/GameplayStatics.h" ATank::ATank() { @@ -24,6 +25,7 @@ void ATank::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) void ATank::Move(float Value) { FVector DeltaLocation = FVector::ZeroVector; - DeltaLocation.X = Value; + float DeltaTime = UGameplayStatics::GetWorldDeltaSeconds(this); + DeltaLocation.X = Value * DeltaTime * Speed; this->AddActorLocalOffset(DeltaLocation); } \ No newline at end of file diff --git a/Source/ToonTanks/Tank.h b/Source/ToonTanks/Tank.h index 8a985c1..37d0409 100644 --- a/Source/ToonTanks/Tank.h +++ b/Source/ToonTanks/Tank.h @@ -27,5 +27,8 @@ private: UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Component", meta=(AllowPrivateAccess = "true")) class UCameraComponent* Camera; + UPROPERTY(EditAnywhere, Category = "Movement", BlueprintReadWrite, meta=(AllowPrivateAccess="true")) + float Speed = 400.0f; + void Move(float Value); };