Android input error pressing two on-screen buttons at the same time

I have a game intended for touch controls on android. I have three on-screen buttons linked to keyboard button control paths. The touch controls work well using Unity remote, but when building to my phone I get an error when pressing two buttons (move and jump) at the same time.

This is the error that I get from logcat: Unhandled pen event action

My move action is a value Vector2 (the WASD binding is a 2D Vector Digital Normalized used in control scheme K&M and Touch), and my jump button is a button (used in control scheme K&M and touch). I am not using pen input.

Since it works with Unity remote and not android, it must be something specific to how it builds on android.

Upon further testing and Debug Logs, sometimes when pressing two buttons at the same time one of them gets stuck in the Held state (wasreleasedthisframe is never called). On the other hand, while holding a button and tapping a second button wasreleasedthisframe is called on the button being held down.

Using input system debugger, pen input is disabled and all touch events register appropriately. However, there is often times where no input actions are registered even though the debugger registers input on the touchscreen.

Using Unity 6.000.0.32f1 and Input System 1.12.0

Appears related to Unity Issue Tracker - [Android] The button is stuck on a press state when pressing the button quick multiple times

1 Like

inputsystem 1.0.1 works fine with multi touch

I was having a problem using touch controls on Android using the on screen stick. It would work until two fingers were touched anywhere on the screen, then it would lock and no inputs were detected after that. I was using input system version 1.11.2, my unity version is 60000.0.32f1

I upgraded the input system to version 1.13.0 and it has fixed the issue.

Hey Keith I was struggling with a similar problem for the last two days. I had a left and right on-screen button, and (for example) when I hit left while already holding right, the right button would get stuck in a pressed state and only release when I hit it again.

For me the problem seems to be that I was using both the old Input Manager and the new Input System Package (v1.7.0) at once. When I went to Project Settings > Player > Active Input Handling and changed it from Both to Input System Package (New) and then updated my project to exclusively rely on the new input system, the problem disappeared. Hopefully this is helpful!