0

I am currently trying to make a HTC Vive VR game using Unity. I simply want some controller input to press the trigger to shoot a gun.

But I cannot get the input from SteamVR correctly. When looking up tutorials online they are all for an older version.

Im using SteamVR version 2.2.0 and I cannot find any tutorials about it.

Does any of you know how to just get a simple trigger input?

Thanks for any help in advance!

Rick Rasenberg
  • 25
  • 3
  • 11
  • Check the "SteamVR" folder in your assets. There is a pdf called "SteamVR Unity Plugin - Input System". This should get you going. – Nicolas Mar 21 '19 at 10:25

2 Answers2

1

In SteamVR v. 2.2.0 you can access you bindings for example by

SteamVR_Actions._default.GrabGrip.GetStateDown()

the point is that you now access the actions thru SteamVR_Actions not with SteamVR_Inputs like before.

timetosmile
  • 73
  • 1
  • 11
-1

Here is an introduction to the new input system, maybe this will help you:

https://valvesoftware.github.io/steamvr_unity_plugin/tutorials/SteamVR-Input.html

public SteamVR_Input_Sources handType;
public SteamVR_Action_Boolean grabAction;


// Update is called once per frame
void Update () {

    if (CheckGrab())
    {
        Debug.Log("GRAB ACTION");
    }
}

private bool CheckGrab()
{
    return grabAction.GetState(handType);
}

define your actions and bindings at Window->SteamVR Input

DomK
  • 1
  • 1