Issue with XR Toolkit: Controller Button Only Works Once

I have a simple code for the XR Toolkit.

  • When I right-click with the mouse, the menu toggles on and off just fine.
  • When I press the Oculus controller button, it only works once and then stops responding.

I also tried using the mapping method from Valen’s tutorial on YouTube, but the response was the same—only working once.

I even removed the menu toggling code and left just the Debug.Log() statement, but it still only fires once.

Does anyone have any idea why this is happening or how I can fix it? I would really appreciate any help!

void Update()
{
    if (Input.GetButtonDown("Fire2"))
    {
        // Toggle the in-game menu
        menuInGame.SetActive(!menuInGame.activeSelf);
        Debug.Log("Fire2 button clicked - toggling menu");
    }
}

Fix:
This is probably stupid, but
I changed the input handling mode to this “new”, similar to https://www.youtube.com/watch?v=6lPiO8TrZkc

From what I understood, oculus considered it as “continuous clicks” and it must have been bugged, changing to “new” input gave me the option to start “button” mode

And it works, strange that I couldn’t with the above code.

What you are seeing is the difference between the legacy Input Manager code and the new Input System package code. I am not sure why the first example did not work continuously, but using the Input System route (specifically with OpenXR) is what we recommend and honestly the best path forward to ensure you are using the latest best-practices and get the broadest platform reach for your content.