I started using UserInputService and I found that I would have to cast my own mouse ray to get the typical Mouse.Target/Mouse.Hit properties I'm accustomed to.
I found ScreenPointToRay which looked like it would do what I needed, but I've encountered an issue
--input is an InputObject, camera is CurrentCamera
local ignore = {}
local mouseRay = camera:ScreenPointToRay(input.Position.X, input.Position.Y, 999)
local target, hit = workspace:FindPartOnRayWithIgnoreList(mouseRay, ignore)
I've found that FindPartOnRay is ignoring all parts leaving target nil and hit's position is at the end of the ray. Am I doing this wrong here or could there be a bug on Roblox's end? I'm open to alternatives as long as it doesn't use the mouse.
Edit: I've found the depth property of ScreenPointToRay to be an offset for the Ray.Origin and the Ray length is 1 stud...

1 comment
Thanks, that's what I went with last night. I wish the documentation was a little more clear, so I can avoid running around like this.