Skip to content
Snippets Groups Projects

add HitActor Interaction bug fix into 4.27

1 file
+ 2
2
Compare changes
  • Side-by-side
  • Inline
@@ -63,7 +63,7 @@ void UBasicVRInteractionComponent::BeginInteraction()
@@ -63,7 +63,7 @@ void UBasicVRInteractionComponent::BeginInteraction()
PressPointerKey(EKeys::LeftMouseButton);
PressPointerKey(EKeys::LeftMouseButton);
if (HitActor->Implements<UGrabable>() && Hit->Distance < MaxGrabDistance)
if (HitActor && HitActor->Implements<UGrabable>() && Hit->Distance < MaxGrabDistance)
{
{
// call grabable actors function so he reacts to our grab
// call grabable actors function so he reacts to our grab
IGrabable::Execute_OnBeginGrab(HitActor);
IGrabable::Execute_OnBeginGrab(HitActor);
@@ -76,7 +76,7 @@ void UBasicVRInteractionComponent::BeginInteraction()
@@ -76,7 +76,7 @@ void UBasicVRInteractionComponent::BeginInteraction()
// we save the grabbedActor in a general form to access all of AActors functions easily later
// we save the grabbedActor in a general form to access all of AActors functions easily later
GrabbedActor = HitActor;
GrabbedActor = HitActor;
}
}
else if (HitActor->Implements<UClickable>() && Hit->Distance < MaxClickDistance)
else if (HitActor && HitActor->Implements<UClickable>() && Hit->Distance < MaxClickDistance)
{
{
IClickable::Execute_OnClick(HitActor, Hit->Location);
IClickable::Execute_OnClick(HitActor, Hit->Location);
}
}
Loading