Hello all,
I have a dragging mechanic in my game that fires an action whenever the mouse goes over a clickdetector. This works just fine when using a mouse, but when testing or emulating with any touch-based device (e.g. iPad, iPhone) the ClickDetector’s .MouseHoverEnter event doesn’t fire while dragging.
I looked through documentation and didn’t find any similar events but for touch input. What can I do for a workaround?
The UserInputService sports most events that you’ll need in terms of utilising player input, without using methods exposed by button objects. If you have a look around, you’ll notice various functions you can seek out and if they may help you. In terms of using one of the input functions (InputBegan/Changed/Ended), InputObjects contain information about the input that was passed.
I use RunService:BindToRenderStep() and RunService:UnbindToRenderStep() to keep the code responsive and avoid unnecessary checks when the dragging isn’t active