SolidJuho Posted February 26, 2021 Share Posted February 26, 2021 (edited) Hello, I am using HTC Vive Trackers, VIU 1.12.2, SteamVR 2.7.4. I am trying to get data when trigger is pressed by connecting pin 1 to pin 4, but I am not getting logs. It is working and logging data for all other pins correctly, only pin 4/trigger is one not working. I have tested and checked that all pins are working correctly in SteamVR test mode. This is my current code to log all tracker data for debug purposes only: foreach (TrackerRole track in Enum.GetValues(typeof(TrackerRole))) { foreach (ControllerButton item in Enum.GetValues(typeof(ControllerButton))) { if (ViveInput.GetAnyPress(track, new ControllerButtonMask(item))) { Debug.Log("GetPress: " + track.ToString()+" " + item.ToString()); } } foreach (ControllerAxis item in Enum.GetValues(typeof(ControllerAxis))) { if (ViveInput.GetAxisEx(track, item) > 0.5f) { Debug.Log("GetAxis: " + track.ToString() + " " + item.ToString()); } } if (ViveInput.GetTriggerValueEx(track) > 0.5f) { Debug.Log("GetTrigger: " + track.ToString()); } } Edited February 26, 2021 by SolidJuho Link to comment Share on other sites More sharing options...
VIVE_chengnay Posted February 26, 2021 Share Posted February 26, 2021 @SolidJuho Which Unity Editor version did you use? You mean trigger is not working for all(GetPress, GetAxis and GetTrigger)? Link to comment Share on other sites More sharing options...
SolidJuho Posted February 26, 2021 Author Share Posted February 26, 2021 @chengnayHey, I am using Unity 2019.4.17f. And yes, trigger is not working at all. GetPress, GetAxis nor GetTrigger. Link to comment Share on other sites More sharing options...
VIVE_chengnay Posted February 26, 2021 Share Posted February 26, 2021 @SolidJuho Another quick question, did you try your script in VIU's Example scene? Link to comment Share on other sites More sharing options...
SolidJuho Posted February 27, 2021 Author Share Posted February 27, 2021 @chengnay Yes, I just tested on VIU Example 0. Tutorial scene. All other pins are working, expect trigger. Link to comment Share on other sites More sharing options...
VIVE_chengnay Posted March 2, 2021 Share Posted March 2, 2021 @SolidJuho This is a known issue that we haven't update it to the public version. Please modify below script to fix it manually. In Assets\HTC.UnityPlugin\ViveInputUtility\Scripts\ViveInput\ControllerState.cs, line 221, // update hair trigger var rawTriggerPressed = currState.GetButtonPress(VRModuleRawButton.Trigger); var prevTriggerPressed = GetPress(ControllerButton.Trigger, true); var currTriggerPressed = currTriggerValue == 0f ? rawTriggerPressed : (prevTriggerPressed ? currTriggerValue >= 0.45f : currTriggerValue >= 0.55f); Let me know if this still did not fix your issue. Thanks! Link to comment Share on other sites More sharing options...
Banking Posted May 4, 2021 Share Posted May 4, 2021 If you use tracker you can use this code if(ViveInput.GetAnyPress(track , new ControllerButtonMask(ControllerButton.Grip))) { Debug.Log("Hit"); } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now