Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Bug Player Input Auto-Switch breaks On-Screen Controls

Discussion in 'Input System' started by HellGate94, Jul 12, 2021.

  1. HellGate94

    HellGate94

    Joined:
    Sep 21, 2017
    Posts:
    132
    this has been an issue forever now and now that it is no longer in preview i expected it to be fixed.

    here a video of the issue:


    i guess things happen as follows:
    touch events get consumed by on-screen stick => sends gamepad input => player input switches to gamepad => touch event gets canceled since gamepad is now active

    am i simply configuring it wrong or how come this has not come up yet anywhere?
     
  2. dmytro_at_unity

    dmytro_at_unity

    Unity Technologies

    Joined:
    Feb 12, 2021
    Posts:
    212
    Would you mind please to file a bug (Help->Report a Bug) and we will have a look, thanks!

    I was recently fixing related issue to Keyboard.current going null related to On-Screen controls getting enabled/disabled, so likely there is a similar situation where on-screen control calls MakeCurrent and confuses Player Input.

    We probably need to rethink whole Device.current situation, it feels like a suboptimal approach, maybe Device.any would make more sense, e.g. Keyboard.any.spaceKey.wasPressedThisFrame would cover both physical keyboard and on-screen keyboard at a same time.
     
  3. HellGate94

    HellGate94

    Joined:
    Sep 21, 2017
    Posts:
    132
    bug is reported.

    yea not sure what the optimal solution to this is. i have not yet needed multiple input devices so not sure how any would work with that
     
  4. OmarOfMA

    OmarOfMA

    Joined:
    Sep 6, 2022
    Posts:
    13
    Hello @HellGate94
    Do you a link to the bug report?
    I seem to have the same issue or similar.