Like say my cursor is pointing at some point far off in the distance, when I click it would for example print the position of where it's pointing at. I haven't really gotten a clear answer by googling it either.
You need raycasting. Here's the function I use:
function Convert2DTo3D(camera, x, y, maxDist, ignoreList) --returns the object hit followed by the coordinate hit --maxDist and ignoreList are optional. ignoreList can be a table or an instance. local ray = camera:ScreenPointToRay(x, y) ray = Ray.new(ray.Origin, ray.Direction * (maxDist or 999.5)) local basePart, hit if type(ignoreList) == "table" then basePart, hit = workspace:FindPartOnRayWithIgnoreList(ray, ignoreList) else basePart, hit = workspace:FindPartOnRay(ray, ignoreList) end return basePart, hit end --Sample usage: print(Convert2DTo3D(workspace.CurrentCamera, 50, 100))
In the example case I used coordinates 50, 100. You'll want to use the mouse's actual coordinates; possibly on MouseMove (see UserInputService)
The general idea is really just these two steps:
ScreenPointToRay
mouse.hit
Not entirely sure how you'd find the position, most likely using raycast which I haven't done in a few months.
Do some digging on the wiki with mouse.hit and I'm sure you'll find what you're looking for.