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)
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.
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.