From 1298dfef3e7d599e80d485114a4b5b299cef93be Mon Sep 17 00:00:00 2001 From: David Gilbert <david.gilbert@rwth-aachen.de> Date: Tue, 12 Mar 2024 12:51:53 +0100 Subject: [PATCH] Apply 1 suggestion(s) to 1 file(s) --- .../Interaction/Interactors/DirectInteractionComponent.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/RWTHVRToolkit/Private/Interaction/Interactors/DirectInteractionComponent.cpp b/Source/RWTHVRToolkit/Private/Interaction/Interactors/DirectInteractionComponent.cpp index 5de410ff..c8cf9ce3 100644 --- a/Source/RWTHVRToolkit/Private/Interaction/Interactors/DirectInteractionComponent.cpp +++ b/Source/RWTHVRToolkit/Private/Interaction/Interactors/DirectInteractionComponent.cpp @@ -112,7 +112,8 @@ void UDirectInteractionComponent::OnBeginInteraction(const FInputActionValue& Va if (bOnlyInteractWithClosestActor) { auto MinElement = *Algo::MinElementBy( - CurrentInteractableComponentsInRange, [&](auto Element) + CurrentInteractableComponentsInRange, + [&](auto Element) { return FVector(Element->GetOwner()->GetActorLocation() - InteractionLocation).Size(); }); MinElement->HandleOnActionStartEvents(this, InteractionInputAction, Value, EInteractorType::Direct); CurrentlyInteractedComponents = {MinElement}; -- GitLab