Search Issue Tracker

Active

Under Consideration for 1.10.X

Votes

0

Found in [Package]

1.10.0

Issue ID

ISXB-1005

Regression

No

InputSystem.onAnyButtonPress gets called every frame when the controller analog stick is moved while its button is being pressed down

Package: Input System

-

Reproduction steps:
1. Open the attached “Input-System-Test.zip“ project
2. Connect Xbox controller and enter Play mode
3. Hold any of the controller buttons down (ex. South) and move the analog stick
4. Observe the Console

Expected result: “onAnyButtonPress Button:/XInputControllerWindows/buttonSouth” log is thrown once
Actual result: “onAnyButtonPress Button:/XInputControllerWindows/buttonSouth” log is thrown more than once

Reproducible with: 1.7.0 (2021.3.42f1), 1.10.0 (2021.3.42f1, 2022.3.40f1, 6000.0.14f1)

Reproduced on: Windows 11 Pro
Not reproduced on: No other environment tested

Notes:
- User reported that documentation on onAnyButtonPress says: "The listener will get triggered whenever a ButtonControl on any device in the list of devices goes from not being pressed to being pressed."[https://docs.unity3d.com/Packages/com.unity.inputsystem@1.10/api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_onAnyButtonPress|https://docs.unity3d.com/Packages/com.unity.inputsystem@1.10/api/UnityEngine.InputSystem.InputSystem.html#UnityEngine_InputSystem_InputSystem_onAnyButtonPress|smart-link] But they get it called many times if press a gamepad button is pressed and the analog stick is moved
- User reported that this issue is reproducible on a common Windows gamepad (XInputControllerWindows)
- Issue is reproducible with Xbox controller via bluetooth and via cord
- DualSense and Nintendo Switch Pro controllers throw logs until button is released
- User reported that {{onAnyButtonPress}} gets triggered for any button in a non-default state because it relies on {{GetFirstButtonPressOrNull()}} and this method does not check if the button was pressed that frame

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.