function ScreenSpace.ScreenToWorldByWidthDepth(q,O,V,d)local u=ScreenSpace.AspectRatio()local U=math.tan(math.rad(Workspace.CurrentCamera.FieldOfView)/2)local S=u*U local L,a=ScreenSpace.ViewSizeX(),ScreenSpace.ViewSizeY()local m=(((V/L)*2)*-S)*d local f,i=(q/L)*2-1,(O/a)*2-1 local X=(f*-S)*d local Q=(i*U)*d return Vector3.new(X,Q,d),m end
-- ScreenSpace -> WorldSpace. Taking a screen width, and a depth to put an object
-- at, and returning a size of how big that object has to be to appear that size
-- at that depth.
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
