How would I detect if a player is dragging their mouse on the y axis on a SurfaceGUI?

What I’m trying to achieve is, if a player drags either up or down while holding leftmouse. Then increment a number based on how far the mouse has travelled. I already tried doing a hacky “workaround” by creating an invisible draggable frame but as you (may) know draggable is deprecated and the updated position does not replicate serverside.

Something abit like this.

track their mouse
whenever mouse moves, compare the Y level
if Y level increases enough, then change the number

look at UserInputService:getMouseDelta(), it returns the mouse’s movement in the previous frame

Get the players mouse position. Then store it in a storage variable that is not inside your loop. Then compare the 2 values and see if the y difference is less or greater than 0.

It only works if the mouse is locked and not in default mode.

my bad, yeah what you said is how to do it in non locked mode :+1: