- Home /
Why is my Oculus touch controller button state 0?
Hey I just started trying to get output from the Oculus touch controller buttons, analog sticks, and triggers in Unity 5.5.0f3. I made a c# script to modify position and rotation of a cube with the touch controllers and output button status to the console.
public class PlayerControllers : MonoBehaviour {
public GameObject rController;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
rController.transform.localPosition = OVRInput.GetLocalControllerPosition(OVRInput.Controller.RTouch);
rController.transform.localRotation = OVRInput.GetLocalControllerRotation(OVRInput.Controller.RTouch);
Debug.Log(OVRInput.Get(OVRInput.Axis1D.SecondaryIndexTrigger));
}
The script is attached to an empty in the scene of which the camera/headset and cube are both children. The rotation and position of the cube changes and works as expected but the button press just reads 0 constantly.
I have also tried it with button presses as well and I just get False the whole time.
There was a test input scene that I found here and when I went to open that scene. I received the following prompt.

I assume that when they say different setup they mean a different version of Unity.
So is there some setting somewhere I need to change? Some asset I need to import that I have not or is it the version of unity.
Side Note: The Oculus headset works and tracks fine in the scene, it's just the buttons that I can't get for some reason.
Thank you for any help you can provide.
Answer by Hanne_Huygelier · Mar 05, 2017 at 03:27 PM
I don't know whether you still need an answer, but the oculus touch controllers only start working from a certain version of unity on. To test whether the controllers can work in your Unity3D version you can use this method https://docs.unity3d.com/ScriptReference/Input.GetJoystickNames.html to check whether unity can find the oculus touch controllers. If you have a correct Unity version you should find the oculus remote and touch controller L and R in the output of GetJoystickNames. If they are not in the output of that function, you need to update Unity.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How to switch between two prefabs Cardboard cameras? 0 Answers
Unity XR get controller thumb stick axis 0 Answers