local g=game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")local function C()local C=workspace.CurrentCamera local Q=g:GetMouseLoation()return C:ViewportPointToRay(Q.X,Q.Y)end return C
--[[
	Returns a unit ray from the camera to the mouse's position.

	This is useful in conjunction with other code to make longer rays that shoot
	towards the direction of the mouse.

	Usage:

		local unitRay = getMouseRay()
		local ray = new Ray(unitRay.Origin, unitRay.Direction.mul(math.huge))
]]

local UserInputService = game:GetService("UserInputService")

local function getMouseUnitRay()
	local camera = workspace.CurrentCamera
	local location = UserInputService:GetMouseLoation()

	return camera:ViewportPointToRay(location.X, location.Y)
end

return getMouseUnitRay
