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;