0
\$\begingroup\$

I am using the XR Interaction Manager in Unity VR. The player can hold objects when pressing the trigger button of the hands (the interactable object has the component XR Grab Interactable).

I want to detect if the object is being held or not, so when the player lets go of the object, something happens.

I can't simply detect if the trigger is being held, because that would simply give true even though the object isn't actually being held in that hand.

How should I know if an object is being held? Is there a boolean somewhere?

\$\endgroup\$
1
  • \$\begingroup\$ Checking the docs, it looks like there's an Activated event invoked when the object is grabbed, and a Deactivated event invoked when the object is dropped. Have you tried subscribing to these events to manage your held state? \$\endgroup\$
    – DMGregory
    Aug 4 at 16:56

0

You must log in to answer this question.

Browse other questions tagged .