Search Unity

Oculus OVR Grabber script. Can I use the Index Trigger instead of the hand Trigger?

Discussion in 'AR/VR (XR) Discussion' started by bugzilla, Mar 30, 2018.

  1. bugzilla

    bugzilla

    Joined:
    Dec 9, 2008
    Posts:
    196
    I have created a VR scene in Unity for use with the Oculus Rift. I have the OVR Grabber script attached to the hand objects so the user can grab objects, but the script will only let me use the "PrimaryHandTrigger". I think the "PrimaryIndexTrigger" would be more intuitive. I do not see any way to get the OVR Grabber script to use it. Does anyone know a way to get this script to use the Index Trigger instead of the Hand Trigger?
     
  2. Arch_N_Game

    Arch_N_Game

    Joined:
    Sep 29, 2018
    Posts:
    1
    If anyone look into this, you can find the value at line 150 on OVRGrabber.cs, you just have to change "hand" to "index"
     
    janeshvarmishra likes this.
  3. spatto

    spatto

    Joined:
    Jun 29, 2017
    Posts:
    1
    Thanks for this! And if you want either to work, you can use:

    Code (CSharp):
    1.         m_prevFlex = Mathf.Max(OVRInput.Get(OVRInput.Axis1D.PrimaryIndexTrigger, m_controller), OVRInput.Get(OVRInput.Axis1D.PrimaryHandTrigger, m_controller));
     
    janeshvarmishra likes this.