- Home /
OpenVR controllers Vive
Hello all,
I was using steamvr asset before but since the new unity vr lightweight renderpipeline is out i though trying using the openvr. So i have been looking at the docs about it: OpenVRController
But somehow my brain isnt understanding it.
I have this:
Debug.Log(Input.GetJoystickNames()[0]);
Debug.Log(Input.GetJoystickNames()[1]);
showing this: And that is nice and all but i need the buttons i need to know when the trigger is pressed. And that i don't get I checked the Input manager that is showing oculus_gearVr.
But I need the vive input, since unity does recognize the vive controller I assume that it is able to detect the buttons somehow aswell but I dont seem to figure out how it works.
Answer by Bodhid · Nov 06, 2018 at 02:53 PM
Here is a list of each button and axis: https://docs.unity3d.com/Manual/OpenVRControllers.html
Map those button and axis id's in the input manager to use them.
Use the InputTracking class for position and rotation of thecontrollers. https://docs.unity3d.com/ScriptReference/XR.InputTracking.html
For vibration, look in the OpenVR unity plugin.
Aha... Thanks... Ok between you folks this is the clearest explanation of this stuff that I've seen... Does this setup on the Input $$anonymous$$anager look right to you? And if it does - any ideas why calling Debug.Log(Input.GetAxis("RightControllerV")); - constantly returns 0 ?
Answer by rosssssss · Dec 04, 2018 at 11:36 AM
I've tried any combination of the "Axis" and "Joy Num" Ids to correspond to the "Unity Axis ID" in the https://docs.unity3d.com/ScriptReference/Input.GetAxis.html table. and i can't seem to get any values flowing through from the Vive controllers. IDs for the Thumbpad Horizontal and Vertical Axes should be Left 1,2 and Right 4,5