Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
appminis's avatar
appminis
Explorer
9 years ago

OVRInput.Touch isn't working

Hi,

Is there something wrong with this code for using the touch sensitive buttons?

      if (OVRInput.Get(OVRInput.Touch.SecondaryIndexTrigger))
        {

            Debug.Log("Right Hand, Trigger touch");
        }

Tried PrimaryTrigger, Thumbstick, etc. but if never seems to produce any results.

2 Replies

Replies have been turned off for this discussion
  • kersk's avatar
    kersk
    Meta Employee
    Hmm, that code snippet is correct and works for me.

    Can you share your version of Unity, Oculus Utilities, OVRPlugin, and SDK? (Those get logged out when entering play mode w/ the Utils)

    Is it only the Touch sensitive inputs that are not working? What about OVRInput.Button.SecondaryIndexTrigger or OVRInput.Button.One? Can you log OVRInput.GetActiveController() and OVRInput.GetConnectedControllers() to verify they match expectations. And you do have an instance of OVRManager.cs in the scene? That's needed for the input state to update correctly.
  • Aha!  OVRManager was in the scene, but for some reason not active.  Works great now, thanks!