Search Unity

  1. Read here for Unity's latest plans on OpenXR.
    Dismiss Notice

[OVR] How to know which game object is grabbed with the controller

Discussion in 'AR/VR (XR) Discussion' started by Elandir, Sep 24, 2016.

  1. Elandir

    Elandir

    Joined:
    Feb 9, 2014
    Posts:
    32
    Hi there.
    We are beginnig to deal with Oculus VR and the controlers making a small pick-and-drop items game using the Grabbable.cs script.

    At this point to make things work properly we need a way to know which item is grabbed from such item scripts. Our first try was to have every item checking for position changes but it doesn't seem a good way (besides it doesn't work properly when I try to move one item which have others attached) so I need some better way.

    We thought that there migh exist some method similar to Unity's OnMouseDown but we coldn't find it. Anyone knows if such method actually exist or how we can know grabbed items from other scripts??
     
unityunity