Unity OVRInput.Get() caching for performance?
In Unity, I normally cache any GetComponent() if I plan on using it within the Update(). Is the OVRInput.Get similar? Everyone online seems to just put code like OVRInput.Get(OVRInput.RawButton.X) directly in Update() and even inside their IF statements. Is this the recommended method for performance? Is the OVRManager handling everything and I just need to call the OVRInput.Get and not worry about it. What about if I am using that OVRInput.Get in multiple if statements in my script? Should I assign the OVRInput.Get as a boolean at the beginning of the Update() and then use that in my script or would that only really help readability but not have an impact on performance? Thanks!Solved644Views0likes2CommentsOVR Input and OVR Camera Rig
I have an Mac Studio with Unity 2021.3.2f1 installed - with Oculus integration. It is actually not possible to use the OVR Input prefab because the OVR Camera reference is greyed out. There is no possibility to drag the OVR Camera Rig prefab into it as mentioned in the document. Does anybody have a workaround for that?1.8KViews0likes0CommentsOVRInputModule primary index trigger is unreliable.
Hi. I am having an issue wher the OVRInputModule is not working with me properly when I try to use the Primary Index Trigger. I have UI elements in my game including toggles and sliders. If I use the A button, I am able to interact with these widgets successfully. However, when I use the primary index trigger, it is hit or miss whether or not my input is registered. For the "Joy Pad Click Button", I have "One" and "Primary Index Trigger" selected. I did put some breakpoints in the function virtual protected PointerEventData.FramePressState GetGazeButtonState() and it does seem like the pressed and released variable are toggled on and off properly when I use the A button or the trigger on the right controller. Any ideas? Thanks, John Lawrie2.7KViews0likes2CommentsOVRInput.Get(OVRInput.Axis2D.SecondaryThumbstick) always returns (0,0)
Hi. I am developing a Unity game for the oculus quest. I have an issue where I always get a value of (0, 0) returned when I query the value of the left thumbstick. When I query the value of the right thumbstick, I get real values if isLeftController is set, I have never been able to get a value other than (0, 0). If it is not set, it correctly gives me the value for my right thumbstick. if (isLeftController) { axes = OVRInput.Get(OVRInput.Axis2D.SecondaryThumbstick); } else { axes = OVRInput.Get(OVRInput.Axis2D.PrimaryThumbstick); } Any idea why this might be? Thanks John Lawrie1.8KViews0likes0CommentsUsing OVRInputModule with 2 controllers.
Hello. I am trying to figure out how to use the OVRInputModule in my game with 2 controllers. I want to have 2 laser beam that comes out of each controller, very similar to how the UI works in the dashboard. However, I can only get one laser to move and be attached to its controller at once. This is my hierarchy. And these are the details of my EventSystem In the OVRInputModule, if the RayTransform and Cursor are set to the ConquestOVRLaserPointer that is a child of the RightControllerAnchor, the laser attached to the right controller will move when the right controller does, but the left laser will not move. If, on the other hand, I set the RayTransform and Cursor to the ConquestOVRLaserPointer that is a child of the LeftControllerAnchor, then the laser attached to the left controller will move when the left controller does and the right laser will not move. Since there is only one on RayTransform and Cursor slot, how do I get it so that the lasers attached to both controllers can move at once? Thanks for any help John LawrieSolved4.1KViews0likes2Comments(press and hold) oculus home button from within Unity Application?
Hello, I'm developing for Quest 2. I am wondering if there's a way to automatically press and hold the Oculus Home button (on right hand controller) from within the app. Rather than bringing up the Oculus home menu, I need to do this to reset the position of the user in the virtual environment, after they have wandered away from a central location (this game utilizes 6 DOF and is carried out standing up). For some context - users are moved along 'tracks' within the game by gazing in certain directions. They should only be able to walk away from these tracks for very short distances - hence the necessity to reset position. In the documentation that describes the Map Controller inputs, it looks like the Oculus home button is reserved. If it is not possible to access it within Unity, is there any other way around this (to achieve this spatial position and orientation 'resetting' function?)Wondering if I may need to resort to a custom function. Thanks in advance!1.4KViews1like0CommentsWhy is OVR.Get() not returning correct values for Axis2D arguments, on Quest?
I am experimenting with some Quest development, and having trouble getting the thumbstick input values to read. I am able to get buttons and 1 dimensional axes to read, but not 2d axes for whatever reason. Below is a test I did: These give the proper values: Debug.Log("PrimaryIndexTrigger " + OVRInput.Get(OVRInput.Axis1D.PrimaryIndexTrigger)); Debug.Log("One " + OVRInput.Get(OVRInput.Button.One)); These give all zero's or false, and never update in response to controller input: Debug.Log("Two " + OVRInput.Get(OVRInput.Button.Two)); Debug.Log("PrimaryThumbstickDown " + OVRInput.Get(OVRInput.Button.PrimaryThumbstickDown)); Debug.Log("PrimaryThumbstickLeft " + OVRInput.Get(OVRInput.Button.PrimaryThumbstickLeft)); Debug.Log("PrimaryThumbstickRight " + OVRInput.Get(OVRInput.Button.PrimaryThumbstickRight)); Debug.Log("PrimaryThumbstick " + OVRInput.Get(OVRInput.Touch.PrimaryThumbstick)); Debug.Log("SecondaryThumbstick " + OVRInput.Get(OVRInput.Touch.SecondaryThumbstick)); Debug.Log("SecondaryThumbstick " + OVRInput.Get(OVRInput.Axis2D.SecondaryThumbstick)); Debug.Log("PrimaryThumbstick " + OVRInput.Get(OVRInput.Axis2D.PrimaryThumbstick)); Debug.Log("LThumbstick " + OVRInput.Get(OVRInput.RawAxis2D.LThumbstick)); Debug.Log("LTouchpad " + OVRInput.Get(OVRInput.RawAxis2D.LTouchpad)); Debug.Log("PrimaryTouchpad " + OVRInput.Get(OVRInput.Axis2D.PrimaryTouchpad)); Debug.Log("SecondaryTouchpad " + OVRInput.Get(OVRInput.Axis2D.SecondaryTouchpad)); Funny enough, the a button (the "One" enum) works while the b button ("Two") doesn't. Running Unity 2019.1.2f1 with the latest Oculus android package and Oculus integration. I tried completely removing the OpenVR package as well to no avail. It's all very strange to me, hoping I can find some insight on here.2KViews1like2CommentsCross-platform input for Valve Index
Hi, we are using Oculus integration 1.42 cross-platform input for Oculus Rift & Steam VR. On HTC Vive it is working but not on Valve index. For example left thumbstick and left hand grip are not working. Are there any other button mappings or should we use their SDK? Thanks.3.3KViews4likes9CommentsBack button not working on quest
I am unable to read the back button on the quest controllers. All other buttons work fine. I have tried the following: OVRInput.Get(OVRInput.Button.Back) OVRInput.GetUp(OVRInput.Button.Back) OVRInput.GetDown(OVRInput.Button.Back) all return false. I have also tried reading the escape key as I have read that some people say this works but no success. How can such a simple thing not be working? Please help, thanks. I am using the latest version 19 of oculus integration downloaded from the asset store.1.5KViews0likes2Comments