Is there a way to get tap position on the screen?

I want to detect where the player taps on the screen on mobile,
similar to [Mouse.Position], Because I want to set the position of the Ui to where the player taps
or to detect if he’s tap holding, so the Gui follows where he taps.

2 Likes

Im pretty sure mobile users also use mouse.Position

2 Likes

Really!, Thank you so much, but now, this makes my question look stupid :rofl:

local UserInputService = game:GetService("UserInputService")
local function TouchTap(touchPositions, _gameProcessedEvent)
local Position = Vector2.new(touchPositions[1].X, touchPositions[1].Y)
end
UserInputService.TouchTap:Connect(TouchTap)
2 Likes

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