Search Unity

Steamvr Input Binding Always Requires Reassignment

Discussion in 'VR' started by lowbl_dan, Apr 15, 2019.

  1. lowbl_dan

    lowbl_dan

    Joined:
    Jan 22, 2019
    Posts:
    34
    Hi all,

    I am working on multiple VR projects and I am trying to implement multiple controls into the controller in addition to the default ones because I don't intend to use multiple tools such as the one provided in the demo. The default bindings only have certain controls, so I have to manually assign buttons to the default bindings, particularly DPad touch inputs and axis. However, when i change projects, the bindings constantly require reassignment.

    default.png

    I am using SteamVR's event system for queries. I could access inputs from other binding sets such as "Buggy"to get other forms of controls but it will return false if it is not set as the primary binding. If anyone knows a better way to approach this, please kindly share. Thanks!

    Code (csharp):
    1.  
    2. //my current sample Vive Input
    3.  
    4.  private SteamVR_Action_Boolean grabGripAction = SteamVR_Input.GetAction<SteamVR_Action_Boolean>("GrabGrip"); //this is from the default bindings
    5.  
    6. void OnEnable()
    7. {
    8.  grabGripAction.AddOnStateUpListener(GrippedReleased, steamVRBehavior.inputSource);
    9. }
    10.  
    11. void GrippedReleased(SteamVR_Action_Boolean fromAction, SteamVR_Input_Sources fromSource)
    12.  {
    13.        
    14.  }
    15.