function ScreenSpace.ScreenToWorld(Q,T,S)local w=ScreenSpace.AspectRatio()local t=math.tan(math.rad(workspace.CurrentCamera.FieldOfView)/2)local j=w*t local A,V=(Q/ScreenSpace.ViewSizeX())*2-1,(T/ScreenSpace.ViewSizeY())*2-1 local D=(A*-j)*S local q=(V*t)*S return Vector3.new(D,q,S)end
-- ScreenSpace -> WorldSpace. Raw function taking a screen position and a depth and
-- converting it into a world position.
function ScreenSpace.ScreenToWorld(x, y, depth)
	local aspectRatio = ScreenSpace.AspectRatio()
	local hfactor = math.tan(math.rad(workspace.CurrentCamera.FieldOfView) / 2)
	local wfactor = aspectRatio * hfactor
	--
	local xf, yf = x / ScreenSpace.ViewSizeX() * 2 - 1, y / ScreenSpace.ViewSizeY() * 2 - 1
	local xpos = xf * -wfactor * depth
	local ypos = yf * hfactor * depth
	--
	return Vector3.new(xpos, ypos, depth)
end
