- Home /
What's the BEST: most efficient, reliable, cross-platform way to detect a touch/tap on mobile (Android-iOS) on several 2D colliders in a scene while still retaining desktop compatibility and raycast/touch masking?
Hi,
I've already seen and read dozens of questions and answers about how to detect a tap/touch on a 2D object on mobile (OnMouseDown, raycasts, sending messages to the touched object, using touch-receiver classes, browsing a list of touchable objects to check the bounds, etc.)
But, what's the best (if it makes any sense to talk about "best"), fastest, more reliable way to handle this?
This has to be as fast as possible for mobile (10-30 touchable objects in the same scene), must work seamlessly on Android and iOS, and still retain the compatibility for desktop builds for mouse clicks.
It shouldn't cause any unacceptable peak in performance or memory allocation in the long run.
It also should take care of canvas masking, so the touch should not breach and propagate to possible 3D objects behind the touch.
Should I leverage on the new 4.6 UI classes like Standalone Input Module, Event System or Graphic Raycaster (that by default get created on the Canvas and on the Event System object). Do these classes already provide some way to handle the touch without having to reinvent the wheel?
Is there any suggested asset on the asset store that handles all this nicely, or is it simpler than what I think?
Thanks for your time
Your answer
Follow this Question
Related Questions
mouse input to touch input help please 0 Answers
Detect if finger lifted off screen 1 Answer
Convert Mouse Input to Touch Input 0 Answers
touch sensitive problem 0 Answers
Multitouch Hold and Move 0 Answers