I currently have a fullscreen canvas UI button that works perfectly with click/tap interactions. However, I would like to extend its functionality to also detect swipe gestures, specifically swipe up and swipe down, while keeping the original click/tap behavior intact.
Could you please advise on the best way to implement swipe detection on this button, and if there are any potential issues I should be aware of when combining both types of interactions?
well, there are several aspects to consider, you’d basically gate your swipe detector using a dragThreshold (your InputSystem’s default one would do – EventSystem.current.pixelDragThreshold).
you might get away with just overlaying an image on top of your button and add a script which only ‘captures’ the pointer event once it moves beyond that pixelDragThreshold.