Search Unity

Question "device.TryGetFeatureValue(CommonUsages.primaryButton, out primaryButtonState)" not working

Discussion in 'AR/VR (XR) Discussion' started by MarcusHimself, May 12, 2020.

  1. MarcusHimself

    MarcusHimself

    Joined:
    Mar 20, 2013
    Posts:
    10
    Hi,

    I tried to set up a project for the Oculus Rift S and followed this page: https://docs.unity3d.com/Manual/xr_input.html

    I managed to detect if the headset is present or not by doing something like this: "m_headset.TryGetFeatureValue(CommonUsages.userPresence, out currentPresenceState);". So in general this whole TryGetFeatureValue thing works.
    The problem though: when I try getting the value of the trigger or primaryButton I don't get it.

    I even tried copying the code of the PrimaryButtonWatcher example to my project and it's not working. The controllers are detected but the primaryButtonState stays false.

    To rule out mistakes from my side I even created a new project(2019.3.13f1) with the new XR Plugin (3.2.10) but the result stays the same... do I miss something super obvious? Shouldn't this work?

    I think I need some help...