function ScreenSpace.ScreenToWorldByWidthDepth(M,c,Z,N)local z=ScreenSpace.AspectRatio()local C=math.tan(math.rad(workspace.CurrentCamera.FieldOfView)/2)local O=z*C local t,L=ScreenSpace.ViewSizeX(),ScreenSpace.ViewSizeY()local i=(((Z/t)*2)*-O)*N local H,F=(M/t)*2-1,(c/L)*2-1 local U=(H*-O)*N local n=(F*C)*N return Vector3.new(U,n,N),i end

function ScreenSpace.ScreenToWorldByWidthDepth(x, y, screenWidth, depth)
	local aspectRatio = ScreenSpace.AspectRatio()
	local hfactor = math.tan(math.rad(workspace.CurrentCamera.FieldOfView)/2)
	local wfactor = aspectRatio*hfactor
	local sx, sy = ScreenSpace.ViewSizeX(), ScreenSpace.ViewSizeY()
	--
	local worldWidth = (screenWidth/sx) * 2 * -wfactor * depth
	--
	local xf, yf = x/sx*2 - 1, y/sy*2 - 1
	local xpos = xf * -wfactor * depth
	local ypos = yf *  hfactor * depth
	--
	return Vector3.new(xpos, ypos, depth), worldWidth
end
