Skip to content
Snippets Groups Projects

feature(Interaction): improve grabbing

5 files
+ 14
11
Compare changes
  • Side-by-side
  • Inline

Files

@@ -36,10 +36,12 @@ UPrimitiveComponent* UGrabBehavior::GetHighestParentSimulatingPhysics(UPrimitive
}
void UGrabBehavior::OnActionStart(USceneComponent* TriggeredComponent, const UInputAction* InputAction,
const FInputActionValue& Value)
const FInputActionValue& Value)
{
if (bObjectGrabbed)
{
return;
}
USceneComponent* Hand = Cast<USceneComponent>(TriggeredComponent->GetAttachParent());
@@ -79,7 +81,7 @@ void UGrabBehavior::OnActionStart(USceneComponent* TriggeredComponent, const UIn
}
void UGrabBehavior::OnActionEnd(USceneComponent* TriggeredComponent, const UInputAction* InputAction,
const FInputActionValue& Value)
const FInputActionValue& Value)
{
USceneComponent* Hand = Cast<USceneComponent>(TriggeredComponent->GetAttachParent());
@@ -103,7 +105,9 @@ void UGrabBehavior::OnActionEnd(USceneComponent* TriggeredComponent, const UInpu
bool UGrabBehavior::TryRelease()
{
if (!bObjectGrabbed)
{
return false;
}
if (MyPhysicsComponent)
{
Loading