Oculus Inputs

Forums:

Ref: Oculus controller layout and mapping One of the things that I found somewhat difficult playing with controller interaction was getting the inputs to work as expected. Now granted, I understand that most of this is due to my own experience, (or lack there-of) but it seemed like no matter what I tried from examples did not work. If it did work, it seemed like I had difficulties duplicating it from scratch.
I believe part of this in part was due to not fully understanding the controllers. The link above however provides some very useful information on how the controllers are mapped and the input naming conventions, as well as some sample code to get you going with controller interaction. After applying some of these, I was able to get interaction working, though I do not fully understand and still need to review it more. Comically, this is part of the scripting guide and its first link reference points back to itself.. heh. There are a few things that I found along the way if you may also be struggling with input. 1. Input must be a child of a canvas game object. If you simply drag and drop an input, dropdown, button etc.. Unity will automatically wrap it under a canvas. 2. Canvas/Input Navigation Canvas elements within the scene have a navigation flow which you can see by clicking visualize on the input object properties. I believe this is similar to "tab" flow on html or win controls. It also appears that navigation is not canvas independent, meaning that multiple canvas objects in the scene will join in the navigation as you can see in the two canvas forms in the image above. You do have the ability to turn off navigation in the object dropdown if you so choose. I have not played with navigation much and will put it on my list of things to learn. With keyboard input I could see this functioning as tab stops but not sure on controllers. 3. Layer Interaction Matrix in Player Settings/Physics This one I found in a video and was unaware of its existence and that is the interaction matrix. At first it made no sense, it was just the same thing twice but one axis was reverse order. After thinking about it, it is the ability to say objects in the top column layer such as hands can only interact with objects in the left row you select such as grabbable. A real world example would be that you could prevent your "kid" layer from interacting with your "hot stove" layer thus providing safe environment for your children. heh. Upon review, I noticed that all of my layers were checked, so I will need to consider interactions in the game as well... sometime in the future. 4. Turn on System Keyboard One thing I have found is that TextMeshPro inputs appear to function better than just standard inputs. Instead of dropping a normal UI input try using the TMPro ones. If you are either grabbing text from the input or populating it dynamically you will need to add a reference in your code to TMPro.