function ScreenSpace.ScreenToWorldByHeightDepth(Q,x,n,Z)local N=ScreenSpace.AspectRatio()local g=math.tan(math.rad(Workspace.CurrentCamera.FieldOfView)/2)local T=N*g local y,V=ScreenSpace.ViewSizeX(),ScreenSpace.ViewSizeY()local W=((-(n/V)*2)*g)*Z local r,d=(Q/y)*2-1,(x/V)*2-1 local e=(r*-T)*Z local p=(d*g)*Z return Vector3.new(e,p,Z),W end

function ScreenSpace.ScreenToWorldByHeightDepth(x, y, screenHeight, 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 worldHeight = -(screenHeight/sy) * 2 * hfactor * 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), worldHeight
end
