I've tried touchstarted, but it returns a screen position (which makes z=0) I want it to return a vector3 from the map for wherever they touch on their screen Any idea on how to do so?
✓ ANSWER ACCEPTED
How can I get a Position on the map with Mobile Devices?
1 answer
✓ Accepted answer
Assuming where they touch it moves the 'mouse' to the coords of the touch you can get the position of where they touched with mouse.Hit
local player = game.Players.LocalPlayer
local mouse = player:GetMouse() --gets the mouse
local uis = game:GetService("UserInputService")
uis.TouchStarted:connect(function()
if mouse.Hit then --mouse.Hit is a cframe
print('Player touched at '..mouse.Hit.p) --.p gets the position from the CFrame
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Worked. Thanks!