Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unity's New Input system breaks touch input on android. #766

Open
timbotimbo opened this issue Feb 13, 2023 · 2 comments · May be fixed by #938
Open

Unity's New Input system breaks touch input on android. #766

timbotimbo opened this issue Feb 13, 2023 · 2 comments · May be fixed by #938
Labels
android This issue is specific to the Android Platform. bug This issue refers to a bug in the plugin

Comments

@timbotimbo
Copy link
Collaborator

timbotimbo commented Feb 13, 2023

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:

  1. Open the example project
  2. Change the input system in the unity player settings to the new package.
    input system
  3. Install the Input system package from the package manager.
  4. In the scene, open the EventSystem-> Standalone input module.
    There should be a button to update it to the Input System UI Input Module.
  5. Canvas buttons now work using the new input system.

Steps to reproduce the behavior:

  1. Make a unity export of the example with the new input system.
  2. 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.
@timbotimbo timbotimbo added bug This issue refers to a bug in the plugin android This issue is specific to the Android Platform. labels Feb 13, 2023
@timbotimbo timbotimbo changed the title Unity's New Input system is breaks touch on android. Unity's New Input system breaks touch input on android. Feb 27, 2023
@kcrebound
Copy link

Got the same problem, disabled useAndroidViewSurface: false to fix problem with handling swipe events on android, for emulators actually it is working good, but for real device it is breaks inputs at all

This workaround causes quite a few bugs so I would not recommend doing this.

can you explain this part? Which bugs do you have here?

@timbotimbo
Copy link
Collaborator Author

timbotimbo commented Aug 16, 2023

Some drawbacks that I have noticed using useAndroidViewSurface: true

Because of things these (and probably more) I never use that mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android This issue is specific to the Android Platform. bug This issue refers to a bug in the plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants