function ScreenSpace.ScreenToWorld(g,n,D)local t=ScreenSpace.AspectRatio()local C=math.tan(math.rad(workspace.CurrentCamera.FieldOfView)/2)local w=t*C local o,F=(g/ScreenSpace.ViewSizeX())*2-1,(n/ScreenSpace.ViewSizeY())*2-1 local y=(o*-w)*D local c=(F*C)*D return Vector3.new(y,c,D)end

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
