function ScreenSpace.ScreenToWorldByHeight(M,r,f,l)local Y=ScreenSpace.AspectRatio()local F=math.tan(math.rad(Workspace.CurrentCamera.FieldOfView)/2)local t=Y*F local L,g=ScreenSpace.ViewSizeX(),ScreenSpace.ViewSizeY()local m=-(g*l)/((f*2)*F)local W,T=(M/L)*2-1,(r/g)*2-1 local z=(W*-t)*m local X=(T*F)*m return Vector3.new(z,X,m)end

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