Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved Accessing menuButton on Oculus Quest 2

Discussion in 'XR Interaction Toolkit and Input' started by avieln, Sep 1, 2021.

  1. avieln

    avieln

    Joined:
    Dec 26, 2019
    Posts:
    2
    Hey!

    I'm building a game for Oculus Quest 2, I'm using the new input system and the Grip and Trigger are working great.

    Now I'm trying to access the menuButton on the left controller with no luck.

    That's the schema

    upload_2021-9-1_2-35-50.png

    upload_2021-9-1_2-36-46.png

    and the code for PauseMenu

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.InputSystem;
    3.  
    4. namespace Game
    5. {
    6.     public class PauseMenu : MonoBehaviour
    7.     {
    8.         [SerializeField] private InputActionReference menuInputActionReference;
    9.  
    10.         private void OnEnable()
    11.         {
    12.             menuInputActionReference.action.started += MenuPressed;
    13.         }
    14.  
    15.         private void OnDisable()
    16.         {
    17.             menuInputActionReference.action.started -= MenuPressed;
    18.  
    19.         }
    20.  
    21.         private void MenuPressed(InputAction.CallbackContext context)
    22.         {
    23.             Debug.Log("MenuPressed!");
    24.         }
    25.     }
    26. }
    The log message "MenuPressed" never appears, am I doing something wrong?

    I'm using XR Interaction Toolkit Version 1.0.0-pre.3

    Thanks!
     

    Attached Files:

  2. freso

    freso

    Joined:
    Mar 19, 2013
    Posts:
    72
    Try using "start" instead of "menuButton", in the Input system.
     
  3. avieln

    avieln

    Joined:
    Dec 26, 2019
    Posts:
    2
    Thanks! it worked!
     
  4. LuigiNicastro

    LuigiNicastro

    Joined:
    Feb 7, 2018
    Posts:
    32
    I've tried this same set up but am unable to get the menuButton to work on the Quest 2. It runs fine through PCVR but when I build it's not recognizing the menu button. I've tried both menuButton and Start but no luck, any ideas?
     
  5. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Could you elaborate on how you're checking the device? New Input has a lot of ways to do it.
     
    LuigiNicastro likes this.
  6. LuigiNicastro

    LuigiNicastro

    Joined:
    Feb 7, 2018
    Posts:
    32
    Sorry for late reply, my notifications were off. I made a new action for XRI Left Hand called Toggle. It's checking for menuButton[LeftHand XR Controller] (this one only works on PCVR not when it's built on Quest) and then I have secondaryButton [LeftHand XR Controller] (this is my temp solution until I get the menu button to work).

    I hope that makes sense
     
  7. andersoncc

    andersoncc

    Unity Technologies

    Joined:
    Apr 9, 2021
    Posts:
    14
    Hey, this button in the Oculus left controller is the start button.
    Have you tried the following bind path for Quest: <XRController>{LeftHand}/start
    It'll show up as: start [LeftHand XR Controller]

    upload_2022-2-4_12-1-55.png
     
  8. LuigiNicastro

    LuigiNicastro

    Joined:
    Feb 7, 2018
    Posts:
    32
    I'll have to double check, I swear I did. Have you tried this on a build for the Quest standalone?
     
  9. andersoncc

    andersoncc

    Unity Technologies

    Joined:
    Apr 9, 2021
    Posts:
    14
    Yeah, I did a build with this configuration for Quest 2 and it worked fine.
     
    LuigiNicastro likes this.
  10. LuigiNicastro

    LuigiNicastro

    Joined:
    Feb 7, 2018
    Posts:
    32
    I'm not sure why but I am not seeing that option here. Even when I go through all of the XR Controller Left Hand options, I don't see one that says Start. Are you on the most up to date version? upload_2022-2-15_9-44-4.png
     
  11. andersoncc

    andersoncc

    Unity Technologies

    Joined:
    Apr 9, 2021
    Posts:
    14
    The latest version should be fine.
    Maybe it's the selected control scheme (the first toolbar option in the editor action window).
    Try to set it to "All Control Schemes", like in the image.

    upload_2022-2-22_16-10-8.png
     
  12. LuigiNicastro

    LuigiNicastro

    Joined:
    Feb 7, 2018
    Posts:
    32
    Still no luck on this one :( I'm on all control schemes and don't see the option sadly
     
  13. andersoncc

    andersoncc

    Unity Technologies

    Joined:
    Apr 9, 2021
    Posts:
    14
    Sorry to hear that. Are you using OpenXR? If this is the case, the binding for this button should be: <OculusTouchController>/menu
    upload_2022-4-4_13-27-1.png
     
  14. elik745i

    elik745i

    Joined:
    Apr 21, 2022
    Posts:
    1
    Same same here, I have assigned trigger button and it works, but when assigning menu or menuButton or both together, still cant display menu.
     
  15. ImreT01

    ImreT01

    Joined:
    Jun 13, 2016
    Posts:
    4
    If anyone struggles with this, the quick search does not show all 'start' binding paths.

    problem.gif

    But if you step by manually you can find the option.

    solution.gif

    The 'start' binding works. It was tested on Quest1 android build. I use the Unity 2021.3.1f1 with these XR packages:
    upload_2022-5-20_18-10-52.png
     
    azevedco likes this.
  16. LuigiNicastro

    LuigiNicastro

    Joined:
    Feb 7, 2018
    Posts:
    32
    Weird I followed your video and didn't see it but I'm also on 2020.3.16 so maybe that's why
     
  17. andersoncc

    andersoncc

    Unity Technologies

    Joined:
    Apr 9, 2021
    Posts:
    14
    Hey @LuigiNicastro, I can try to reproduce your issue here, can you please provide your setup? The version of your installed packages and the XR provider(s) (Oculus, OpenXR, etc) your are using.
     
  18. GoingS

    GoingS

    Joined:
    Nov 2, 2015
    Posts:
    2
    I'm not him but I can't find the Start either.

    I'm on Unity 2020.3.30f1 and these are the packages being used
    upload_2022-6-1_12-35-16.png

    and these are my interaction profiles
    upload_2022-6-1_12-36-26.png

    PS: I forgot to mention but I'm testing using Vive Focus with HTC Stream mode (runs on pc, streams on headset), but the issue with the Menu button is the same I believe.
     

    Attached Files:

    Last edited: Jun 1, 2022
  19. andersoncc

    andersoncc

    Unity Technologies

    Joined:
    Apr 9, 2021
    Posts:
    14
    @GoingS If you're using Open XR the binding for this button (on the left controller) is <OculusTouchController>/menu

     
  20. AndrewLaBoyXR

    AndrewLaBoyXR

    Joined:
    Sep 23, 2016
    Posts:
    9
    @andersoncc this binding isn't working. I'm also having this issue. 2021.2.18f1

    OpenXR version is 1.3.1, I am testing on an Oculus Quest 2. (Not Oculus Link)

    I've tried Oculus Touch Controller Menu, OculusTouchController Left Menu, XRController Left Hand Menu, XRController Left Hand MenuButton, XRController Menu, XRController MenuButton, and I don't have Start button in any menus, even when not using quick search. This code below works if I change the button to the trigger:

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.InputSystem;

    public class MenuToggle : MonoBehaviour
    {
    [SerializeField] InputActionAsset inputActions;
    InputAction menuToggle;
    bool menuActive;
    [SerializeField] GameObject menuPanel;

    // Start is called before the first frame update
    private void Start()
    {
    var inputActionMap = inputActions.FindActionMap("XRI LeftHand Interaction");
    menuToggle = inputActionMap.FindAction("Menu Toggle");
    menuToggle.performed += ToggleMenu;
    menuToggle.Enable();
    }

    public void ToggleMenu(InputAction.CallbackContext context)
    {
    if (menuActive)
    {
    menuActive = false;
    menuPanel.SetActive(false);
    }
    else
    {
    menuActive = true;
    menuPanel.SetActive(true);
    }
    }
    }
     
    Last edited: Jun 11, 2022
  21. andersoncc

    andersoncc

    Unity Technologies

    Joined:
    Apr 9, 2021
    Posts:
    14
    Hi @AndrewLaBoyXR
    I've tested your script with a Quest 2 build and it worked fine. I've used Unity 2021.2.18f1 (Open XR 1.3.1) with the
    <OculusTouchController>/menu
    binding, here it's my Input Action config:

    upload_2022-6-14_10-24-28.png

    Maybe it's just a configuration. Are you sure you're using the
    Oculus Touch Controller Profile
    with
    Oculus Quest Support
    enabled?
    upload_2022-6-14_10-29-20.png
     
  22. azevedco

    azevedco

    Joined:
    Mar 2, 2014
    Posts:
    34
    Updated my OpenXRPlugin to 1.3.1 and was able to find the "start" option in my binding path. Cheers!

    Just want to mention, using the "start" binding works in builds for Quest 2, however not in Editor. So i'd say just keep the original binding for "menuButton" for use in Editor alongside your "start" binding.
     
    ImreT01 and VRDave_Unity like this.
  23. btatum

    btatum

    Joined:
    Jun 9, 2021
    Posts:
    1
    Just an FYI, if you are pasting "<XRController>{LeftHand}/start" as a binding, make sure you hit enter so it takes it
     
    ImreT01 likes this.
  24. unity_77609A299314CFF882B1

    unity_77609A299314CFF882B1

    Joined:
    May 21, 2022
    Posts:
    2
    HI, i am facing same issue using unity 2021.3.8f1/ xr interaction toolkit 2.1.1, I cant see Start option for Xr controller or oculus controller for left hand.. i have attached my screenshot for reference please help..
     

    Attached Files:

  25. WiredEarp

    WiredEarp

    Joined:
    Jul 12, 2016
    Posts:
    4
    @andersoncc Thanks! Not selecting Oculus Quest support was exactly the problem for me. I found other suggestions online, like upgrading to the latest version of OpenXR (already on it), or using 'Start' instead of 'menu'. None of these were valid options. Its a bit hard to diagnose as you need Oculus Quest for this button, but all the other buttons seem to work fine without enabling Oculus Quest support.
     
  26. Alex_the_Coder

    Alex_the_Coder

    Joined:
    Dec 3, 2018
    Posts:
    17
    Hi,
    this solution worked for me:
    As others I couldn't find the "start" binding. The bindings menu, home, app, system, etc. didnt work. I then clicked the "T" symbol besides the binding to manually paste"<XRController>{LeftHand}/start" there and hit enter.

    This worked.

    Additionally you can add this to comply with meta quest guidelines to pause when opening the oculus dash:

    private void OnApplicationFocus(bool focus)
    {
    #if !UNITY_EDITOR
    if (isPaused)
    return;
    if (focus)
    return;
    isPaused = true;

    PauseGame(); //Your code here

    #endif
    }
     
    tsunetsune and ImreT01 like this.
  27. ImreT01

    ImreT01

    Joined:
    Jun 13, 2016
    Posts:
    4
    Hi! Again.
    Recently, I updated the Unity editor to 2021.3.24f1 and it was the only solution that worked for me too on Quest 2. Thank you.
    I use these packages:
    upload_2023-5-12_20-5-52.png
     
  28. joeysipos

    joeysipos

    Joined:
    Jul 28, 2015
    Posts:
    41
    Has anyone figured out why some people are able to access the "Start" binding and other are not? That seems pretty odd. I for one do not see it listed.