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

Drag Threshold doesn't seem to work for mobile

Discussion in 'UGUI & TextMesh Pro' started by tinman, Sep 26, 2015.

  1. tinman

    tinman

    Joined:
    Jan 8, 2011
    Posts:
    229
    I'm setting up a standard mobile joystick UI. Left joystick moves the character and right joystick looks around. I lowered in the Drag Threshold in the UI event system to 1 (from the default of 5) so a drag begins right away as opposed to waiting for 5 pixels to be dragged. When testing with mouse in the editor, this works fine. With a mobile build (android), a certain drag threshold is still there.

    Any ideas as to why?

    PS. Once a drag is started, the accuracy is seems to be ok, it's just that initial drag still awaits a few pixels before being applied (this causes a small jump in movement).

    Thanks!
     
  2. lilithgame

    lilithgame

    Joined:
    Sep 29, 2015
    Posts:
    2
    This is a very serious problem! Hope anyone can solve it.
     
  3. Berno

    Berno

    Joined:
    Oct 29, 2014
    Posts:
    39
    I agree. Drag threshold works fine in the editor and has no effect on Android.
    Will look at raising an issue.
     
  4. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    @tinman

    Well, I'm not sure if I've had to counter this issue, can't remember but there is at least this:

    EventSystem.pixelDragThreshold

    I think I haven't used it, but maybe it's helpful in your case can you try and see if it helps?
     
  5. Trungdv

    Trungdv

    Joined:
    Dec 1, 2012
    Posts:
    22
    Agree. In my case, Drag threshold works fine in the Editor but it has no effect on iOS (Unity 2018.3, iOS 11). Do anyone know how to solve this problem?