Using ClickDetector's MouseHoverEnter with touch devices

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?

You may want to try Mouse.Target as an alternative.
Although I’m unsure if this would solve the issue.

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.

Hmm, I guess that could work with a loop while the dragging is active.

Oh well, I was hoping for something better than this workaround. Thanks though!

2 Likes

You could use Mouse.Move:Connect()
I personally think it’s better than while loops to prevent unnecessary checks.

1 Like

I use RunService:BindToRenderStep() and RunService:UnbindToRenderStep() to keep the code responsive and avoid unnecessary checks when the dragging isn’t active :grin:

1 Like