From 1c47cd6778c4f068402009f15bb59950b658c800 Mon Sep 17 00:00:00 2001 From: Johannes Theiner Date: Sat, 13 Mar 2021 19:57:51 +0100 Subject: [PATCH] =?UTF-8?q?T=C3=BCren=20Toleranz=20wieder=20hinzugef=C3=BC?= =?UTF-8?q?gt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/BuildingEscape/RotatingActor.cpp | 2 +- Source/BuildingEscape/RotatingActor.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/BuildingEscape/RotatingActor.cpp b/Source/BuildingEscape/RotatingActor.cpp index 2737a79..a0a6a07 100644 --- a/Source/BuildingEscape/RotatingActor.cpp +++ b/Source/BuildingEscape/RotatingActor.cpp @@ -21,7 +21,7 @@ void URotatingActor::TickComponent(float DeltaTime, ELevelTick TickType, FActorC if (rotating) { FRotator Rotation = GetOwner()->GetActorRotation(); - if (Rotation.Equals(targetRotation, 1.0f)) + if (Rotation.Equals(targetRotation, Tolerance)) { rotating = false; } diff --git a/Source/BuildingEscape/RotatingActor.h b/Source/BuildingEscape/RotatingActor.h index 0420ea0..9eaad13 100644 --- a/Source/BuildingEscape/RotatingActor.h +++ b/Source/BuildingEscape/RotatingActor.h @@ -38,6 +38,9 @@ public: UPROPERTY(EditAnywhere) bool Negative = false; + + UPROPERTY(EditAnywhere) + float Tolerance = 1.f; private: FRotator targetRotation;