Search Unity

XRGrabInteractable Help De-selecting?

Discussion in 'AR/VR (XR) Discussion' started by tobaccoblonde, Jun 2, 2020.

  1. tobaccoblonde

    tobaccoblonde

    Joined:
    Apr 18, 2017
    Posts:
    11
    Hello,

    I'm using XR Interaction Toolkit 0.9.4-preview. Unity 2019.3.8

    I have an XR Rig with left and right hands that can pick up XRGrabInteractable objects just fine.

    I want to a hand to drop a selected/held object with script and I'm stumped. Accessing XRGrabInteractable seems like pain, and the hands are just hands, it's all up to the interactable to mirror the hands.

    Curious where to look and I haven't found much in the documentation.

    Thanks in advance if you could point me in the right direction.
     
  2. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,933
  3. tobaccoblonde

    tobaccoblonde

    Joined:
    Apr 18, 2017
    Posts:
    11
    thanks for the reply. :)

    FWIW the workaround in the link is about a quarter of how you handle dropping an item.

    from memory... on the interactable, you find and tell the interactor that it can't interact anymore, this will drop the object, then you need to know that that specific interactor can't interact with things. so you'll have to store that information somewhere to turn in back on later, definitely not on the same frame, and potentially not on the next...

    the main XR Toolkit thread has a lot of guidance, but no word on a better solution. https://forum.unity.com/threads/xr-interaction-toolkit-preview-release.795684/page-10