Rick Rasenberg
Rick Rasenberg

Reputation: 25

SteamVR Controller Input for version 2.2.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!

Upvotes: 0

Views: 3646

Answers (2)

timetosmile
timetosmile

Reputation: 73

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.

Upvotes: 1

DomK
DomK

Reputation: 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

Upvotes: -1

Related Questions