Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

UI button ignoring touch input Android

Discussion in 'UGUI & TextMesh Pro' started by DevGamePlayGame, May 25, 2016.

  1. DevGamePlayGame


    Dec 10, 2013

    I am facing a very weird issue, where the button ignores input (around 60% of the time) only on Android device.

    This means the end user would have to press the button multiple times until it works which is undesired.

    When run in Unity editor or PC, it worked flawlessly.

    There are other scenes which has buttons, but they work 100% of the time. Only in this scene where the issue happens.

    I've tested on 2 Android device one being high end performance, other in low end.

    I initially thought may be it is to do with low frame rate (~15 - 20 fps Vodafone 875), but this issue persisted even on high end phone (60fps Sony Z5 Compact).

    Things I've checked:
    - Raycast target
    - Interactable
    - Graphic Raycaster
    - Canvas order in layer

    Desired behaviour upon touching button:
    - Fade out the screen
    - Play a selection sound (From Sfx manager)
    - Deactivate the current canvas
    - Enable other canvas.
    - Fade in once fade out is complete
    - Read out the book title (From voice manager)

    Current behaviour upon touching button:
    ~60% of the time, no action. No sound played. No screen transition.
    ~40% of the time, works perfectly.

    Current Hierachy
    Book shelf (Screen overlay canvas)
    - Mask (Also has scroll rect which scrolls parent)
    - Parent (Parent of all books)
    - Books (Buttons that arn't working at the moment)

    Device tested: Sony Z5 Compact (High end) , Vodafone 875 (Low end)
    Unity version tested on: 5.3.4f1, 5.3.5f1

    Please let me know if there are any more information that is required.
    I've attached a screen shot of profiler (using low end phone), Screen shot of the phones (both low end and high end)

    Attached Files:

    Last edited: May 25, 2016
  2. crispybeans


    Apr 13, 2015
    Just a wild guess but maybe some invisible object is covering the screen ? maybe you ave a scroll view with a transparent background that you scroll up and down and only when its scrolled all the way to the top its possible to click the buttons ?

    I have had similar issues in the past where it wasnt actually a bug in my code or in the Unity UI system but rather an issues caursed by a transparent object going ontop of the clickables.

  3. DevGamePlayGame


    Dec 10, 2013
    Thanks for the reply!

    If there was any transparent objects, shouldn't the PC and Editor version not work as well? oO

    I will have a closer look if there are any transparent objects.
  4. DevGamePlayGame


    Dec 10, 2013
    Just solved this issue.

    For those who were having similar problem, the issues was the scroll rect being too sensitive.

    most of the touch was triggering "OnDrag" instead of "OnClick" which was why the button was getting ignored.

    I fixed it by increasing the "Drag Threshold" in EventSystem.
    MarcusRLA and theolagendijk like this.
  5. MarcusRLA


    Jun 5, 2015

    Thanks for posting this, I've been dealing with the same issue.
  6. Jure-Veler


    Mar 31, 2015
    Solved my problem as well. great information!