Skip to content
Snippets Groups Projects
Commit f19cf591 authored by David Gilbert's avatar David Gilbert :bug:
Browse files

fix(interaction): Correctly clears currently interacted components array on interaction end.

parent 65080eeb
No related branches found
No related tags found
2 merge requests!107UE5.4-2024.1-rc1,!91Interaction refactoring and replication
...@@ -123,6 +123,7 @@ void UDirectInteractionComponent::OnBeginInteractionInputAction(const FInputActi ...@@ -123,6 +123,7 @@ void UDirectInteractionComponent::OnBeginInteractionInputAction(const FInputActi
} }
else else
{ {
CurrentlyInteractedComponents.Empty();
CurrentlyInteractedComponents.Reserve(CurrentlyInteractedComponents.Num() + CurrentlyInteractedComponents.Reserve(CurrentlyInteractedComponents.Num() +
CurrentInteractableComponentsInRange.Num()); CurrentInteractableComponentsInRange.Num());
for (UInteractableComponent* InteractableComp : CurrentInteractableComponentsInRange) for (UInteractableComponent* InteractableComp : CurrentInteractableComponentsInRange)
...@@ -144,6 +145,7 @@ void UDirectInteractionComponent::OnEndInteractionInputAction(const FInputAction ...@@ -144,6 +145,7 @@ void UDirectInteractionComponent::OnEndInteractionInputAction(const FInputAction
Value); Value);
} }
} }
CurrentlyInteractedComponents.Empty();
} }
UInteractableComponent* UDirectInteractionComponent::SearchForInteractable(AActor* HitActor) UInteractableComponent* UDirectInteractionComponent::SearchForInteractable(AActor* HitActor)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment