Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

[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??