UI button ignoring touch input Android

Hi.

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)


2648497--186598--ScreenShot_Lowend_Phone.png

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.

Cheers

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.

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.

3 Likes

Thanks for posting this, I’ve been dealing with the same issue.

Solved my problem as well. great information!

Thank you SO MUCH.

Anyone still Looking for solution then you should go to the properties of event system of canvas in play mode and check where the raycasts are going , I mean you can see which object is blocking your clicks in play mode and uncheck the undesired raycast targets Note: unity always keep the raycast targets of all ui elemnts on even the texts so you disable them if not required.

cheers!

Thankks for the solution bro