Search Unity

New Input System - Mobile integration

Discussion in 'Input System' started by Obikson, Mar 9, 2019.

  1. Obikson

    Obikson

    Joined:
    Sep 21, 2017
    Posts:
    8
    I'm trying to implement new input system for mobile device. Problem is that I need some info about setting up layout and binding. I've successfully created keyboard/mouse bindings, setted up some GUI for mobile device that is showing values of pressed input keys, but android device (6.0 Marshmallow) is not registreing any input on debug GUI. Are there any docs, tuts for Mobiles with new input system? Or any advice, or experience?

    This is layout settings for Mobile
    touchInput.PNG
    Player settings
    playersettings.PNG
     
  2. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Unfortunately, we still have some way to go here -- both in terms of docs but also in terms of code. It's high on the list of stuff to get tackled next, though.

    We do have UIActionInputModule to replace StandaloneInputModule from the legacy system and it does have a certain level of touch support. However, aside from having seen little testing so far, we have a deeper problem ATM with actions in combinations with touch. Touchscreen has seen a number of changes under the hood that basically render actions unable to meaningfully work with the device. This is one of the next things that will get fixed.

    When this is all done and proper, all that should be needed is replacing StandaloneInputModule with UIActionInputModule and wiring up some action references. My hope is that we'll eventually have some UI to completely automate that setup, too.
     
  3. nosajtevol

    nosajtevol

    Joined:
    Jun 28, 2012
    Posts:
    219
    Hey, is this still true @Rene-Damm ? Currently converting my game using the new input system to mobile and would love to just use a virtual joystick instead of recoding things.
     
  4. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    It's no longer the case. Touch input both works with actions and is supported by the UI input module.
     
    SlimeProphet likes this.
  5. andyrev

    andyrev

    Joined:
    Oct 5, 2015
    Posts:
    2
    Dear Rene-Damm, I can not setup touch on mobile with new input system. Can you recommend the tutorials or something else?
    Best regards,
    Andy
     
    peterparnes likes this.
  6. peterparnes

    peterparnes

    Joined:
    Jul 5, 2016
    Posts:
    3
    I am also a bit confused on what is needed to get a simple thing a handling of buttons working on mobile (iOS). I works nicely in the desktop UI but on mobile I need to turn on "Active Input Handling" to the old Input System or Both. How do I get a plain ui-button to work on mobile with the new Input System?
     
    d8hoon, qball13z, ppozniak and 2 others like this.
  7. Lkubrick

    Lkubrick

    Joined:
    Nov 8, 2019
    Posts:
    1
    You can use one of the Samples from Unity, there is one for Touch Controls that works great! I had trouble finding this one, but you have presets for mobile, with a demo scene called "Rolling" where there already is a virtual Joystick setup. It's pretty, pretty good.

    I hope this helps.
     

    Attached Files:

    Octoverse and SlimeProphet like this.
  8. FixItFelix

    FixItFelix

    Joined:
    Mar 27, 2017
    Posts:
    54
    We have problems on the ui with that. Touches are not recognized on all devices or at least the system things it is a long tap or so and will not click the button.
     
  9. unity_r71wO1KFVJaK9w

    unity_r71wO1KFVJaK9w

    Joined:
    Dec 15, 2020
    Posts:
    7
    How to read Android system mapped keys(External Keyboard) in unity android? Like we want to read tab on external Keyboard
     
  10. unity_r71wO1KFVJaK9w

    unity_r71wO1KFVJaK9w

    Joined:
    Dec 15, 2020
    Posts:
    7
    Right Mouse Button works in Unity Editor but not on the android device. Kindly help. Also GCKeyboard and GCMouse are introduced on IOS 14 but still keyboard and Mouse are not supported on IOS for new input system
     
  11. EmretheGanjaRaiders

    EmretheGanjaRaiders

    Joined:
    Dec 27, 2014
    Posts:
    21
    I setup my Input Action yesterday it was working when i select Touch Simulation in the Input Debugger. but when i build it for Android its doesnt work. Maybe my device count to the not supported devices. I try to get Vector2 value of the touch delta position to pass it in the cinemachine camera. And a other problem is that the line "playerControls.TouchDelta.canceled += ctx..." is only called when i release while im not moving my finger (on PC with Touch Simulation activated). when i release while its moving, the function dont get called and i cant reset my deltaPos to zero and the camera its rotation till i touch the screen again. In the whole internet i dont find any useful tutorial about touch support.
     
    LateNight74 likes this.
  12. Skotrap7

    Skotrap7

    Joined:
    May 24, 2018
    Posts:
    125
    Has anyone gotten touch to work consistently?
     
  13. Skotrap7

    Skotrap7

    Joined:
    May 24, 2018
    Posts:
    125
    Acoustic125 likes this.