- Home /
Question by
jugglebubbles · Nov 16, 2020 at 11:33 PM ·
inputinputmanagervirtualrealityinputs
HTC Vive XR Input not working
I am using the new Unity XR Input system and I can't for the life of me get any input detection working. My code is provided below; I get 0 errors and the characteristics return properly so it is finding the controller input devices just fine.
using UnityEngine;
using UnityEngine.XR;
public class XRInputManager : MonoBehaviour
{
[SerializeField]
private XRNode xrNode = XRNode.LeftHand;
private InputDevice controller;
void Start()
{
controller = InputDevices.GetDeviceAtXRNode(xrNode);
Debug.Log("CONTROLLER: " + controller.characteristics.ToString());
}
void Update()
{
bool triggerValue;
if (controller.TryGetFeatureValue(CommonUsages.triggerButton, out triggerValue) && triggerValue)
{
Debug.Log("Trigger button is pressed.");
}
}
}
Comment
Your answer
Follow this Question
Related Questions
Current method of reading specific input action states in new system 2 Answers
Is there a way to detect a change in Control Scheme with the new Input System? 1 Answer
create default and customizable inputs 0 Answers
Unity New Input System PerformInteractiveRebinding() 1 Answer
why is the center of my field of view pixelated on my phone when testing for vr 1 Answer