Skip to content
Snippets Groups Projects
Commit 6b13cc06 authored by Marcel Krüger's avatar Marcel Krüger
Browse files

Fix assignment of LastActorHit

parent c3c6e13d
No related branches found
No related tags found
1 merge request!43Feature/targetable leave and enter event
Pipeline #167509 failed
...@@ -119,7 +119,7 @@ void UBasicVRInteractionComponent::TickComponent(float DeltaTime, ELevelTick Tic ...@@ -119,7 +119,7 @@ void UBasicVRInteractionComponent::TickComponent(float DeltaTime, ELevelTick Tic
} }
AActor* HitActor = Hit->GetActor(); 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 // Execute Leave and enter events when the focused actor changed
if (HitActor != LastActorHit) if (HitActor != LastActorHit)
...@@ -142,6 +142,7 @@ void UBasicVRInteractionComponent::TickComponent(float DeltaTime, ELevelTick Tic ...@@ -142,6 +142,7 @@ void UBasicVRInteractionComponent::TickComponent(float DeltaTime, ELevelTick Tic
{ {
ITargetable::Execute_OnTargeted(HitActor, Hit->Location); 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) void UBasicVRInteractionComponent::Initialize(USceneComponent* RayEmitter, float InMaxGrabDistance, float InMaxClickDistance)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment