PinchInputReader can get stuck using polyfill pinch detection, even when the user has switched from hands to controller that has an input profile that has bound controls on the input actions.
To reproduce
Steps to reproduce the behavior:
Configure the MRTK3, version 4.0.0-pre.1, project to build for Quest, and build+deploy the app to a Meta Quest 2 or 3.
While using hands (not controller), start the app, and continue using only hands when the app comes up.
Confirm pinch selection using hands, which on the Quest 2/3 should be utilizing polyfill.
Switch to using the Quest Controller, and notice pinch selection with the controller trigger does not work.
Note: If the app is started using the controller, pinch selection works with the controller, and the user can switch between hands and controller. It is only if the app is started with hands where the issue arises.
This is due to the logic to cache the input action validity for the select & select values upon startup getting locked to false when using hands, and these flags never get re-evaluated when switching input from hands to controller. When they are false, the logic always goes to polyfill. When they are true, as when starting the app with the controller, the logic ends up switching between polyfill and the input actions based on GetIsPolyfillDevicePose(). See code below:
if (!m_isSelectionActionValidCache || !m_isSelectionActionValueValidCache || GetIsPolyfillDevicePose())
{
UpdatePinchSelection();
}
Should we only rely on GetIsPolyfillDevicePose(), or perhaps call UpdateActionValidCaches() every frame instead of only first frame?
Expected behavior
Pinch selection works on the Quest Controller after having switched from hands to controller.
Your setup (please complete the following information)
Unity Version [2022.3.27f1]
MRTK Version or Commit [v4.0.0-pre.1]
Target platform (please complete the following information)
Describe the bug
PinchInputReader can get stuck using polyfill pinch detection, even when the user has switched from hands to controller that has an input profile that has bound controls on the input actions.
To reproduce
Steps to reproduce the behavior:
This is due to the logic to cache the input action validity for the select & select values upon startup getting locked to false when using hands, and these flags never get re-evaluated when switching input from hands to controller. When they are false, the logic always goes to polyfill. When they are true, as when starting the app with the controller, the logic ends up switching between polyfill and the input actions based on GetIsPolyfillDevicePose(). See code below:
Should we only rely on GetIsPolyfillDevicePose(), or perhaps call UpdateActionValidCaches() every frame instead of only first frame?
Expected behavior
Pinch selection works on the Quest Controller after having switched from hands to controller.
Your setup (please complete the following information)
Target platform (please complete the following information)