Fangh Posted October 7, 2021 Posted October 7, 2021 Hello. This piece of code works on Oculus Quest but not on HTC Vive Focus Plus (the debugtext stays empty) Unity 2019.4.29 Vive Input Utility 1.13.4 Vive Wave XR Plugin 4.1.1-r3.2 Vive Wave XR Plugin Essence 4.1.1-r3.2 XR Plugin Management 4.1.0 I need a solution to make a way to get the input from Oculus Quest AND HTC Vive Focus Plus. Thank you
VIVE_chengnay Posted October 7, 2021 Posted October 7, 2021 Hi @Fangh, It seems you have import VIU 1.13.4. You can try following methods to see if this resolves your problem. public ViveRoleProperty role = ViveRoleProperty.New(); if (ViveInput.GetPress(role, ControllerButton.Trigger)) { // } if (ViveInput.GetPress(role, ControllerButton.Grip)) { // } if (ViveInput.GetPress(role, ControllerButton.Pad)) { // } For controller name, you can try below code. var deviceState = VRModule.GetCurrentDeviceState(role.GetDeviceIndex()); deviceState.modelNumber or deviceState.renderModelName Let me know if you have further questions.
Fangh Posted October 7, 2021 Author Posted October 7, 2021 (edited) Thank you. It works on the HTC Vive Focus Plus. But the app crash (and even the play mode) on Oculus Quest. I have renamed the AndroidManifest.xml to AndroidManifest.htc and putted in the Plugins/HTC Folder so it is not build on the Quest apk Edited October 7, 2021 by Fangh
Fangh Posted October 8, 2021 Author Posted October 8, 2021 @chengnay I don't have the Oculus SDK in the project
VIVE_chengnay Posted October 8, 2021 Posted October 8, 2021 @Fangh For running on Oculus platform, you will need to import Oculus Integration SDK or at least Oculus XR Plugin. It will be better to create a new project for Oculus.
Fangh Posted October 8, 2021 Author Posted October 8, 2021 I don't need the Oculus Integration SDK to make a functionnal build for the Oculus Quest. The Oculus XR Plugin is sufficient. My build works well in the Oculus Quest if I remove everything about the WaveXR.
VIVE_chengnay Posted October 8, 2021 Posted October 8, 2021 @Fangh Is your issue resolved? Now you can get inputs for Focus 3 and Oculus Quest?
Fangh Posted October 8, 2021 Author Posted October 8, 2021 (edited) It's now working. (reminder : I don't have the Oculus SDK in my project) This is what I did : Remove Vive Wave Essence Remove Vive Input Utility Remove Vive Wave Native Remove Plugins/Android/CustomManifest.xml Remove Wave/XR/Platform/Android/CustomManifest.xml Using a XRRig (Device Based) Kept only Vive Wave XR Plugin 4.1.1-r3.2 Use the codebase found here : https://hub.vive.com/storage/docs/en-us/UnityXR/UnityXRButton.html#unity-input-helper Here is my code which work both on Oculus Quest and HTC Vive Focus Plus : using UnityEngine; using UnityEngine.InputSystem.XR; using UnityEngine.XR; public class WaveControllerTest : MonoBehaviour { public TextMeshPro debugText; public XRNode node; // Update is called once per frame void Update() { InputHelpers.IsPressed(InputDevices.GetDeviceAtXRNode(node), InputHelpers.Button.Trigger, out bool triggerValue, 0.5f); if (triggerValue) { debugText.text = $"{node}-trigger"; } InputHelpers.IsPressed(InputDevices.GetDeviceAtXRNode(node), InputHelpers.Button.Grip, out bool gripPressed, 0.5f); if (gripPressed) { debugText.text = $"{node}-gripPressed"; } InputHelpers.IsPressed(InputDevices.GetDeviceAtXRNode(node), InputHelpers.Button.PrimaryAxis2DUp, out bool touchpadValue, 0.5f); if (touchpadValue) { debugText.text = $"{node}-touchpad"; } InputHelpers.IsPressed(InputDevices.GetDeviceAtXRNode(node), InputHelpers.Button.PrimaryButton, out bool primaryButton, 0.5f); if (primaryButton) { debugText.text = $"{node}-primaryButton"; } } } Obviously, the primarybutton works only with the Quest but I expected that and that's fine. Edited October 8, 2021 by Fangh
VIVE_chengnay Posted October 8, 2021 Posted October 8, 2021 Just curious why your previous code (without install Oculus XR Plugin) can work on Oculus Quest?
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