Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question InputSystem on-screen joystick touchscreen releases prematurely

Discussion in 'Input System' started by RogueStargun, May 1, 2021.

  1. RogueStargun

    RogueStargun

    Joined:
    Aug 5, 2018
    Posts:
    296
    I have a very odd issue with the InputSystem's On-Screen joystick:
    • Dragging the joystick works fine when playing in the editor (game mode)
    • Dragging the joystick when the game is loaded does not work consistently. For example. I pull left, and instead of the character continuing to move, they simply stop after a few milliseconds as if the joystick was released. Visually, the joystick handle is still pulled to the left.
    I'm using Unity 2019.4.14f1 with InputSystem preview.3 -1.1.0-preview.3

    Is anyone else dealing with this issue? I believe it may have to do with switching between touchscreen and gamepad controls on mobile, but I do not know how to prevent this from happening [???]
     
  2. PhantasmicDev

    PhantasmicDev

    Joined:
    Jul 10, 2013
    Posts:
    35
    Are you handling your input with the PlayerInput component? If so I noticed that when you hit play and watch the PlayerInput component, on the debug section you can see the 'Control Scheme' and 'Devices' flicker between 'Keyboard&Mouse' and whatever device the joystick is feeding input to(in my case 'Gamepad').

    I tried getting input from the generated script of my input actions and there is no stuttering and everything works smoothly. Hope that helps.