From 53c64e90f4faea9e3f2b321e80a36b011f91deb2 Mon Sep 17 00:00:00 2001 From: Rafal Swierczek Date: Mon, 27 Nov 2023 00:12:45 +0000 Subject: [PATCH] Fixed Mini Waypoint Being Stuck to Center of Screen When Main Waypoint Spawns Behind Player --- EndlessVendetta/Content/Levels/TrainingFacility.umap | 4 ++-- .../Source/EndlessVendetta/UserWidgets/MiniWaypoint.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/EndlessVendetta/Content/Levels/TrainingFacility.umap b/EndlessVendetta/Content/Levels/TrainingFacility.umap index af04d0dd..173d1ed4 100644 --- a/EndlessVendetta/Content/Levels/TrainingFacility.umap +++ b/EndlessVendetta/Content/Levels/TrainingFacility.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:68499c0acedf4bd43fa13b5244a3900ad9850ff62e15ac85b1e337859200d06d -size 654847 +oid sha256:ce3870108ae2fe9758eaa20ecb25f73f4623f2e9acad154d2075db2ca0fc1d0f +size 654898 diff --git a/EndlessVendetta/Source/EndlessVendetta/UserWidgets/MiniWaypoint.cpp b/EndlessVendetta/Source/EndlessVendetta/UserWidgets/MiniWaypoint.cpp index 03a7b6be..679372cb 100644 --- a/EndlessVendetta/Source/EndlessVendetta/UserWidgets/MiniWaypoint.cpp +++ b/EndlessVendetta/Source/EndlessVendetta/UserWidgets/MiniWaypoint.cpp @@ -20,8 +20,8 @@ void UMiniWaypoint::NativeTick(const FGeometry& MyGeometry, float InDeltaTime) ArrowImage->SetRenderTransformAngle(TargetYaw - PlayerYaw); // Check if waypoint is outside of players vision frustum - if (FMath::IsWithin(ScreenLoc.X, -0.01, 0.01) && FMath::IsWithin(ScreenLoc.Y, -0.01, 0.01)) - { + if (FMath::IsNearlyZero(ScreenLoc.X) && FMath::IsNearlyZero(ScreenLoc.Y) && !FMath::IsNearlyZero(IconCanvasPanelSlot->GetPosition().X))//(FMath::IsWithin(ScreenLoc.X, -0.01, 0.01) && FMath::IsWithin(ScreenLoc.Y, -0.01, 0.01)) + { // Check if waypoint is closer to the players right bool TargetOnTheRight; if (PlayerYaw >= TargetYaw)