Hey Guys I am using Unity 2018.2.5f1 and running the oculus app software version 1.29.0.651191. Also using the OVR manager from the Oculus Integration plugin version 1.27 from the Unity asset store https://assetstore.unity.com/packages/tools/integration/oculus-integration-82022. So I am just trying to implement the button input for the touch controls using the following script. for now I am just trying to get the triggers working. but the Code (CSharp): OVRInput.Get(OVRInput.Axis1D.PrimaryIndexTrigger, OVRInput.Controller.Touch) Always returns 0 ( on both controllers) and I can't figure out why. I have OVR manager in the scene (and active) but I also added in OVR.Update() and OVR.FixedUpdate() just in case but doesn't seem to make a difference. Code (CSharp): using System.Collections; using System.Collections.Generic; using UnityEngine; //Left touch trigger : Axis 9 (0 -> 1 ) //Right touch trigger : Axis 10 (0 -> 1 ) //Left Joystick Horizontal : Axis 1 (-1 -> 1) //Left Joystick Vertical : Axis 2 (-1 -> 1) //Right Joystick Horizontal : Axis 3 (-1 -> 1) //Right Joystick Vertical : Axis 4 (-1 -> 1) public class PlayerInputVR : MonoBehaviour { [SerializeField] private Weapon weaponLeft; [SerializeField] private Weapon weaponRight; private bool firingLeft = false; private bool firingRight = false; OVRManager ovrManager; // Use this for initialization void Start () { //ovrManager. } // Update is called once per frame void Update () { OVRInput.Update(); WeaponFire(); WeaponSwitch(); if (Input.GetKeyUp(KeyCode.Escape)) { GameManager.Instance.PauseToggle(); } } private void FixedUpdate() { OVRInput.FixedUpdate(); } void WeaponFire() { float leftTrigger = OVRInput.Get(OVRInput.Axis1D.PrimaryIndexTrigger, OVRInput.Controller.Touch); //float rightTrigger = OVRInput.Get(OVRInput.Axis1D.SecondaryIndexTrigger, OVRInput.Controller.Touch); float rightTrigger = OVRInput.Get(OVRInput.Axis1D.SecondaryIndexTrigger); Debug.Log("WEAPON FIRE UPDATE - LT = " + leftTrigger + " RT = " + rightTrigger); if (leftTrigger != 0) { Debug.Log("LEFT TRIGGER PRESS DETECTED"); if (!firingLeft) { firingLeft = true; weaponLeft.Fire(); Debug.Log("FIRE WEAPON"); } } /*if (leftTrigger == 0) { Debug.Log("STOP FIRE WEAPON"); firingLeft = false; }*/ if(rightTrigger != 0) { if (!firingRight) { firingRight = true; weaponRight.Fire(); } } /*if (rightTrigger == 0) { firingRight = false; }*/ } void WeaponSwitch() { } } Also might be worth mentioning if I put this in an update method. Code (CSharp): print("" + OVRInput.GetConnectedControllers()); it DOES print "Touch".
---UPDATE--- BTW all the above was from running it in Editor, haven't tested as a build yet. Also it seems that once running in editor, if I press the Oculus Home button on the Right Touch and then press again to close the input starts to work....
For anyone that has a similar problem, it seems to be working now. Ever since I used the Oculus home button.
I can confirm that this is still an issue as of Nov 4, 2018. Unity version 2018.2.11f1 and Oculus Utilities version 1.28.0. Harrisonhough, thanks for the workaround.
@Harrisonhough thank you for the workaround. We tried restarting headset, controllers, computer editor. But nothing worked. But after clicking the home button and back again, it started working. What a strange bug.
Sorry for continuing the Necro (but this is still a current bug...) If the above work around doens't work, make sure you're not running both Oculus and OpenVR API's. If you are, make sure they're both loading into Unity properly. I had to remove OpenVR, leaving Oculus API in there, and then disable/reenable VR integration in the player settings.
+1 for mentioning this. I had issues with OVRInput.Button.One for both controllers, but all other inputs functioned. Removing OpenVR from the project and only using Oculus in Project Settings/Player/XR worked for me.
OVRInput.Get(OVRInput.Axis1D.SecondaryHandTrigger, OVRInput.Controller.RTouch always reports 0 for me. I can not read Rtouch controller at all. I do not have OpenVr and am only using Oculus in Project Settings/Player/XR.
Just checking, have you installed the Oculus Integration as well as the Oculus Package through the package manager?
I've got this problem too I believe its related to updating the Oculus Spatializer - basically don't... no idea why
I have the same issue. OVRInput.Get(OVRInput.Button.One) always return false... CustomHand prefab from Oculus Integration 1.41 just not work. Yes my hand move related to my controller position but finger doesn't react when i pressing buttons... I tried on Unity 2019.3.9b and 2018.4.12f1... I have an Oculus Quest.
i found the solution by myself. XR Management was imported to my scene. So make sure that XR Management (installed from PackageManager) is not installed with your project.
I coded my unity project on 2018.3.13 version. It was working fine when I copied my file project and run it in another pc this problem appeared for me the versions of unity were the same and the Ovr packages were inside the project. OVRInput.Get(OVRInput.Button.One) doesn't return anything I can move around by joystick. can it be something related to the oculus app ??!!
Using Unity 2020.1 and pressing the Oculus Home button on the Right Touch and then press again to close the input works for me too.
I managed to get this working when the new XR management process in 2019.3. Unity seems to add items into the standard Input Manager in the Project settings section...I used the following code to get them to work... if (Input.GetAxis("Oculus_CrossPlatform_SecondaryIndexTrigger") >= 0.9f && isLoaded) { ShootArrow(); } if (Input.GetButtonDown("Fire1") && !isLoaded) { LoadArrow(); } With those two examples (triggers and buttons) you should be able to figure out the rest. Sometimes you need to do the home button/reset view thing (but I found this was not the case once I figured it out, but maybe it worked better after doing this once). I also noted that it may not work unless something is covering the sensor to make sure something is in the headset eg. a head...so cover that up with a finger or something maybe. Kind of makes sense, but not so good for quick testing. Basically I don't use the OVRInput anymore.
It's March 2020 and this is still happening, and the Oculus Home button fix still works. Thanks for saving me hours of frustration! I luckily found this post just a few minutes after starting to get frustrated. )
*facepalm* Looks like the issue (in my instance) is the HMD needs to begin tracking before Touch controllers fully activate. The HMD sensor is just at the center top. I can either slip the HMD on real fast or cover sensor with my thumb. Once you hear the chime, the OVRInput button outputs begin returning as expected.