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. Dismiss Notice

On Screen Button Holds inadvertently Calling Cancel

Discussion in 'Input System' started by KoalityGame, Nov 1, 2020.

  1. KoalityGame

    KoalityGame

    Joined:
    Jan 30, 2016
    Posts:
    21
    I have on screen button controls for my game which work fine for the most part. One of the buttons in particular is a Hold to move the player forward and Release to stop moving. My issue is when the button is pressed down the player moves as it should, but if there is a slight drag in the mouse/finger the move is canceled which is not desired. This results in unresponsive controls because even a slight movement will cancel the action. The weird part is that it works perfectly fine on Android (the move doesn't cancel) but in the Editor and iOS the action gets canceled. Is there a reason for this inconsistency and is there anything I can do to stop the Cancel from getting called by somehow ignoring drag input?
     
  2. Rene-Damm

    Rene-Damm

    Unity Technologies

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Is this happening with 1.1-preview.2, too? If so, that'd be a bug. Ticket appreciated.
     
  3. KoalityGame

    KoalityGame

    Joined:
    Jan 30, 2016
    Posts:
    21
    I updated to the preview package and yes it still seems to exist. I was able to work around it by creating my own OnScreenButton class and listening strictly only for PointerUp and PointerDown calls and ignoring any drags.