Fixed Multiple Main Waypoints Becoming Focused When Looking at Just One
This commit is contained in:
parent
c51f2ab7b6
commit
797653132e
BIN
EndlessVendetta/Content/BountySystem/Waypoint/BP_Waypoint.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/BountySystem/Waypoint/BP_Waypoint.uasset
(Stored with Git LFS)
Binary file not shown.
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d3943e1a064276d17b897a7a10a3c42a35c75d6c02117bd1ea962544f3576a9b
|
||||
size 654898
|
||||
oid sha256:68499c0acedf4bd43fa13b5244a3900ad9850ff62e15ac85b1e337859200d06d
|
||||
size 654847
|
||||
|
BIN
EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/StarterContent/Particles/P_Ambient_Dust.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset
(Stored with Git LFS)
BIN
EndlessVendetta/Content/StarterContent/Props/MaterialSphere.uasset
(Stored with Git LFS)
Binary file not shown.
@ -46,6 +46,7 @@ void ACheckpointClass::Tick(float DeltaTime)
|
||||
void ACheckpointClass::Destroyed()
|
||||
{
|
||||
if (WaypointActor) WaypointActor->Destroy();
|
||||
Super::Destroyed();
|
||||
}
|
||||
|
||||
|
||||
|
@ -22,7 +22,7 @@ void AWaypointActor::SetupWaypoint_Implementation(UTexture2D* Icon, const FStrin
|
||||
ScalingY_Intercept = ScaleAtMaxDist - (MaxDist * ScalingMagnitude);
|
||||
|
||||
MiniWaypoint = CreateWidget<UMiniWaypoint>(GetWorld(), MiniWaypointClass);
|
||||
MiniWaypoint->AddToViewport(1);
|
||||
MiniWaypoint->AddToViewport(0);
|
||||
MiniWaypoint->WorldLoc = this->GetActorLocation();
|
||||
MiniWaypoint->PlayerController = GetWorld()->GetFirstPlayerController();
|
||||
MiniWaypoint->SetIcon(Icon);
|
||||
@ -51,7 +51,7 @@ bool AWaypointActor::SightCheck()
|
||||
ObjectQueryParams.AddObjectTypesToQuery(ECollisionChannel::ECC_GameTraceChannel2);
|
||||
FVector LT_Start = PlayersCam->GetComponentLocation();
|
||||
FVector LT_End = LT_Start + (PlayersCam->GetForwardVector() * WaypointFocusDistance);
|
||||
if (GetWorld()->LineTraceSingleByObjectType(OutHit, LT_Start, LT_End, ObjectQueryParams)) return true;
|
||||
if (GetWorld()->LineTraceSingleByObjectType(OutHit, LT_Start, LT_End, ObjectQueryParams) && OutHit.GetActor()->GetUniqueID() == this->GetUniqueID()) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -72,3 +72,10 @@ void AWaypointActor::UpdateScaleAndRotation()
|
||||
SetActorScale3D(FVector(1.f, S, S));
|
||||
}
|
||||
|
||||
void AWaypointActor::Destroyed()
|
||||
{
|
||||
if (IsValid(MiniWaypoint)) MiniWaypoint->RemoveFromParent();
|
||||
Super::Destroyed();
|
||||
}
|
||||
|
||||
|
||||
|
@ -47,6 +47,8 @@ protected:
|
||||
UFUNCTION(BlueprintImplementableEvent)
|
||||
void UpdateVisibility(bool IsVisible);
|
||||
|
||||
void Destroyed() override;
|
||||
|
||||
public:
|
||||
// Sets default values for this actor's properties
|
||||
AWaypointActor();
|
||||
|
Loading…
x
Reference in New Issue
Block a user