Closed
Description
Describe the bug
There were multiple users on Discord that mentioned touch not working on android.
After some testing it appears to be because of the new input system in Unity.
Once the New Input System is enabled, touch no longer works on android.
It only occurs with the default useAndroidViewSurface: false
, setting it to true makes touch work again.
This workaround causes quite a few bugs so I would not recommend doing this.
My current advice is to stick with the (default) old input system or use the Both setting.
To Reproduce
Enable the new input:
- Open the example project
- Change the input system in the unity player settings to the new package.
- Install the
Input system
package from the package manager. - In the scene, open the
EventSystem-> Standalone input module
.
There should be a button to update it to theInput System UI Input Module
. - Canvas buttons now work using the new input system.
Steps to reproduce the behavior:
- Make a unity export of the example with the new input system.
- Run it on android and no touch input in Unity will work.
Platform | Old input | New input |
---|---|---|
iOS | ✓ | ✓ |
webGL | ✓ | ✓ |
Android (useAndroidViewSurface: false) | ✓ | ❌ |
Android (useAndroidViewSurface: true) | ✓ | ✓ |
Setup
- Android 7, 9, 12 and 13
- Unity 2021.3.14 and 2022.2.5.