diff --git a/Source/RWTHVRToolkit/Private/Interaction/Interactors/DirectInteractionComponent.cpp b/Source/RWTHVRToolkit/Private/Interaction/Interactors/DirectInteractionComponent.cpp index efa71e268dfd1e0d7cf93e4e4d5359925d674ced..18e515817875cb60c35090b4dbfb4300051b8dac 100644 --- a/Source/RWTHVRToolkit/Private/Interaction/Interactors/DirectInteractionComponent.cpp +++ b/Source/RWTHVRToolkit/Private/Interaction/Interactors/DirectInteractionComponent.cpp @@ -123,6 +123,7 @@ void UDirectInteractionComponent::OnBeginInteractionInputAction(const FInputActi } else { + CurrentlyInteractedComponents.Empty(); CurrentlyInteractedComponents.Reserve(CurrentlyInteractedComponents.Num() + CurrentInteractableComponentsInRange.Num()); for (UInteractableComponent* InteractableComp : CurrentInteractableComponentsInRange) @@ -144,6 +145,7 @@ void UDirectInteractionComponent::OnEndInteractionInputAction(const FInputAction Value); } } + CurrentlyInteractedComponents.Empty(); } UInteractableComponent* UDirectInteractionComponent::SearchForInteractable(AActor* HitActor)