UI Buttons don't fire events on fast input

Hi everyone.

I’m making a mobile game, where player will able to rapidly change characters by pressing ui buttons on the screen.

I’am trying to use standart unity UI buttons, and they work ok from the first glance.

But I’ve ran into the next problem. When you rapidly press one button after another, they didn’t work. I’am not sure if it is only OnClick event that doesn’t fire, or raycast failed to register collision, or unitis ui raycasting doesn’t fast enough to register so many inputs (by rapidly I mean not super fast).

I’ve tryed different canvas configurations (thought something could block raycast on button), but even only with one canvas and these two buttons it still the same.

When I’ve tested gameplay, it is felt like a big problem, when you rapidly changing characters, and sometimes it didn’t work.

Could some one help me with this please, cause I don’t understand what could cause this issue and how to fix it?

P.S. All tests I did on PC. I have event system gameObject. And when you press buttons slowly, they work.

P.S.S. I’ve looked at preview window with event system selected. Seems like there everything is fine. It detrmines selected objects ok. So maybe it is problem with firing OnClick event (but I’m not sure).

Well. After some research and tests I’ve concluded next:

  • Main reason of this happening is that event fires only after button of a mouse is released. And if mouse position at moment of a release doesn’t over button, button press doesn’t happen.
  • This problem, I think, could be solved by tweaking Input module of event system object.
  • In my case (mobile game => touch input) it shouldn’t be a problem (finger in 99% releasing screen in same place where it pressed, if you don’t do slide)