UI buttons sometimes does not detect touch
I have a Canvas, and some buttons on it. Buttons all have a click function set in the inspector. When I touch a button on my mobile device, sometimes the click function is called, sometimes it's not.
I checked there is not any UI element above my buttons that could prevent the click (the touched button always set its "pressed" state)
When I click the button with a mouse on my PC, the click function is always called fine (the problem only exists with the touch)
The main part of my button texture is not transparent, my buttons are classic round buttons
If I add an event trigger on my buttons then I add to this trigger a function PointerClick, I have the exact same situation (sometimes pointerClick detected, sometimes not)
My question is not really about a cheat, I found a cheat : it seems that in my case, I can deal with the pointerUp fonction if I have an event trigger on my button, pointerUp works fine. But I am curious about this problem. What am I missing ? I read posts similar to this one, but it's never exactly the same situation. Any idea about the problem ?
Answer by EdwinFoe · May 26, 2016 at 09:41 PM
I had the same problem. In my case, the reason was that I had both: TouchInputModule and StandaloneInputModule on the same gameObject. Just removing one of inputs solves my problem.