Search Unity

SteamVR_TrackedController not exists, how to know if trigger clicked? SteamVR 2.0

Discussion in 'AR/VR (XR) Discussion' started by CloudyVR, Nov 9, 2018.

  1. CloudyVR

    CloudyVR

    Joined:
    Mar 26, 2017
    Posts:
    715
    I can not figure out how to run function when trigger is clicked. SteamVR has changed too dramatically and now it is mysterious and completely non-function in my game.

    I used to use SteamVR_TrackedController and hook to an even, but now its something more abstract and curious.

    What is it that I must do to simply get the trigger click from a Valve.VR.InteractionSystem.Hand?
     
    castana1962 likes this.
  2. CloudyVR

    CloudyVR

    Joined:
    Mar 26, 2017
    Posts:
    715
    I created an action and then looped while getting the state of that action:

    Code (csharp):
    1. public SteamVR_Action_Boolean clickAction = SteamVR_Input.GetAction<SteamVR_Action_Boolean>("Teleport");
    2.  
    3.     public void Update() {
    4.         var hand = GetComponent<Hand> ();
    5.  
    6.         Debug.Log(clickAction.GetState(hand.handType));
    7.  
    8.     }
    This feels WAY less efficient than the previous way of using callback/hooking to events and only firing when nescessary. Instead now I must include an Update() function to all my objects.

    Not sure what SteamVR is thinking but it sure is turning into one big disaster whatever it is.

    --

    So how do I get trigger Clicked or trigger Released??? Do I have to make temp variable and check for state change myself??

    If so, SteamVR is really going down hill.
     
    Last edited: Nov 9, 2018
  3. castana1962

    castana1962

    Joined:
    Apr 10, 2013
    Posts:
    400
    Yes, Unfortunate the SteamVR SDK have changed a lot and not there are any info about these changes.
    I also used SteamVR_TrackedController to set my controller but now I do not know how I have to do it.
    If anybody know it , please let us the solution...
    Thanks
     
  4. castana1962

    castana1962

    Joined:
    Apr 10, 2013
    Posts:
    400
    Hi trappist-1
    I found this video tutorial in youtube
    Hope this help you !!!
     
  5. StefanXR

    StefanXR

    Joined:
    Jun 6, 2019
    Posts:
    1
    Here is a better Video, where the new Input System for SteamVR 2.0.0 is explained. And it's in English ;-)



    und here is an update for SteamVR 2.2.0
     
    Last edited: Jun 28, 2019