Mobile Finger Position Detection for Tracking

Hey, so I’ve been trying to make a custom inventory system, somewhat unsuccessfully, which led me to use a premade system and modifying it. But, I have two separate versions of it for mobile and pc players, but it has a dragging feature, and this dragging feature is not supported on mobile as it uses mouse position. Currently the rest of the system works, just not how it tracks where to place the frame. So I’m wondering is there anyway I can track the finger position in real time?

local mousePos = Vector2.new(playerMouse.X, playerMouse.Y)
			frame.Position = UDim2.new(0, mousePos.X - (CellSize.X.Offset / 2), 0, mousePos.Y - (CellSize.Y.Offset / 2) + 57)

This code above is my current system which uses mouse position

You could use UserInputService.TouchMoved

or alternatively to be compatible with both mobile and pc you could use UserInputService:GetMouseDelta() and then work on with the delta. This way you would only have to differentiate between and mobile and pc on input beginning and ending , the drag process should remain the same

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.