From 6b13cc06753762576c09ff6fbdb7250614137b74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20Kr=C3=BCger?= <krueger@vr.rwth-aachen.de> Date: Fri, 11 Jun 2021 10:25:48 +0000 Subject: [PATCH] Fix assignment of LastActorHit --- .../Private/Pawn/BasicVRInteractionComponent.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/DisplayClusterExtensions/Private/Pawn/BasicVRInteractionComponent.cpp b/Source/DisplayClusterExtensions/Private/Pawn/BasicVRInteractionComponent.cpp index fe1a96a..20445d3 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) -- GitLab