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

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

parent 952a1ab5
No related branches found
No related tags found
1 merge request!85UE5.3-2023.1-rc3
Pipeline #460926 failed
This commit is part of merge request !85. Comments created here will be created in the context of that merge request.
...@@ -120,6 +120,7 @@ void UDirectInteractionComponent::OnBeginInteraction(const FInputActionValue& Va ...@@ -120,6 +120,7 @@ void UDirectInteractionComponent::OnBeginInteraction(const FInputActionValue& Va
} }
else else
{ {
CurrentlyInteractedComponents.Empty();
CurrentlyInteractedComponents.Reserve(CurrentlyInteractedComponents.Num() + CurrentlyInteractedComponents.Reserve(CurrentlyInteractedComponents.Num() +
CurrentInteractableComponentsInRange.Num()); CurrentInteractableComponentsInRange.Num());
for (UInteractableComponent* InteractableComp : CurrentInteractableComponentsInRange) for (UInteractableComponent* InteractableComp : CurrentInteractableComponentsInRange)
...@@ -139,6 +140,7 @@ void UDirectInteractionComponent::OnEndInteraction(const FInputActionValue& Valu ...@@ -139,6 +140,7 @@ void UDirectInteractionComponent::OnEndInteraction(const FInputActionValue& Valu
Component->HandleOnActionEndEvents(this, InteractionInputAction, Value, EInteractorType::Direct); Component->HandleOnActionEndEvents(this, InteractionInputAction, Value, EInteractorType::Direct);
} }
} }
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