diff --git a/Source/DisplayClusterExtensions/Private/Pawn/BasicVRInteractionComponent.cpp b/Source/DisplayClusterExtensions/Private/Pawn/BasicVRInteractionComponent.cpp index fe1a96a24f513d4f08cd367632ebf0ee3d31b454..20445d353c6affba3e6a0beb3655d3720cc0c605 100644 --- a/Source/DisplayClusterExtensions/Private/Pawn/BasicVRInteractionComponent.cpp +++ b/Source/DisplayClusterExtensions/Private/Pawn/BasicVRInteractionComponent.cpp @@ -119,7 +119,7 @@ void UBasicVRInteractionComponent::TickComponent(float DeltaTime, ELevelTick Tic } AActor* HitActor = Hit->GetActor(); - LastActorHit = HitActor; // Store the actor that was hit to have access to it in the next frame as well + // Execute Leave and enter events when the focused actor changed if (HitActor != LastActorHit) @@ -142,6 +142,7 @@ void UBasicVRInteractionComponent::TickComponent(float DeltaTime, ELevelTick Tic { ITargetable::Execute_OnTargeted(HitActor, Hit->Location); } + LastActorHit = HitActor; // Store the actor that was hit to have access to it in the next frame as well } void UBasicVRInteractionComponent::Initialize(USceneComponent* RayEmitter, float InMaxGrabDistance, float InMaxClickDistance)