function ScreenSpace.ScreenToWorldByWidth(F,D,t,O)local y=ScreenSpace.AspectRatio()local k=math.tan(math.rad(Workspace.CurrentCamera.FieldOfView)/2)local J=y*k local E,B=ScreenSpace.ViewSizeX(),ScreenSpace.ViewSizeY()local s=-(E*O)/((t*2)*J)local L,P=(F/E)*2-1,(D/B)*2-1 local z=(L*-J)*s local Q=(P*k)*s return Vector3.new(z,Q,s)end return ScreenSpace

function ScreenSpace.ScreenToWorldByWidth(x, y, screenWidth, worldWidth)
	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 = - (sx * worldWidth) / (screenWidth * 2 * wfactor)
	--
	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

return ScreenSpace



