do not cache grabbed actors as overlapped actors

This commit is contained in:
Mamadou Babaei
2023-08-14 17:27:37 +02:00
parent 7c2449125b
commit 081eccfdf5
@@ -693,6 +693,11 @@ void ASGPawn::OnRealLeftHandOverlapBegins(
return;
}
if (OtherActor == LeftHandGrabState.GrabbedActor)
{
return;
}
Pimpl->RegisterLeftHandOverlappedActor(OtherActor);
}
@@ -733,6 +738,11 @@ void ASGPawn::OnRealRightHandOverlapBegins(
return;
}
if (OtherActor == RightHandGrabState.GrabbedActor)
{
return;
}
Pimpl->RegisterRightHandOverlappedActor(OtherActor);
}
@@ -1417,6 +1427,15 @@ void ASGPawn::Grab(USGVirtualHandComponent* Hand, AActor* Actor)
Pimpl->DisableActorPhysics(Actor);
}
if (Hand->IsRight())
{
Pimpl->UnregisterRightHandOverlappedActor(Actor);
}
else
{
Pimpl->UnregisterLeftHandOverlappedActor(Actor);
}
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 2
const bool bAttached = Actor->AttachToComponent(Hand, MoveTemp(AttachmentRules), SocketName);
if (bAttached)