Draggable Button that Doesn't 'Click'

How do I…

Essentially I’m trying to differentiate between clicking, and dragging.

Just a plain button prefab or clickable tile, that also has the “draggable” behavior. I want a number to go up when the button is pressed, but NOT when the button is moved via dragging. The problem is that “clicking” just means letting go of the button, which you also do when dragging.

I’ve been at it for days now, and I just can’t think of anything that untangles the drag from the click. I tried (“click” & “(not)hold”), or anything along those lines, I’ve tried defining new hold conditions, adding timers, etc. etc. etc… Please help!

I linked this video in another topic because it’s about something completely different, but here is one way to solve the issue you’re speaking of at this timestamp in the video.

1 Like

This works for me. I used a sound file just as a test.

I think a mode Boolean or toggling the interactions might be better though. To prevent accidental dragging. This uses a toggle button but a Boolean could be added to the click condition. if click and boolean is false or true then do actions.

Edit: I used the opacity to show drag mode but you could also use a filter or any other action as a visual clue.


@Keith_1357 That’s really helpful, thanks! Preventing accidental dragging was going to be the next issue I tackled, so that’s perfect:)

Except instead of a toggle, I was thinking more along the lines of a held tap, like how we move apps around on our phones. That shouldn’t be too hard though.

1 Like