(Solved) How to dectect Oculus Touch left controllor menu click and execute code

I’ve never been so confused by a system before. I’m not sure if it’s me or just the way Unity designed this new Action based input system.

I’ve spent a day trying to figure out how to detect when a player presses the Menu button on the left touch controller in order to execute a function on another GameObject. Does anyone have a simple explanation on how to achieve this?

Many thanks in advance.

I figured it out. I just needed rest and a fresh start.

I added a new Action called Menu in the XRI LeftHand Action Map and bound it to the following path: “start [Left Hand Oculus Touch Controller]”.

Then to handle the button in code:

[SerializeField]
InputActionAsset playerControls;
InputAction menuPress;

void Awake()
{
var gameplayActionMap = playerControls.FindActionMap(“XRI LeftHand”);
menuPress = gameplayActionMap.FindAction(“Menu”);
menuPress.performed += OnMenuPress;
menuPress.Enable();
}

void OnMenuPress(InputAction.CallbackContext context)
{
//Handle Menu Click
}

Works great.