function ScreenSpace.WorldToScreen(q)local O=Workspace.CurrentCamera.CoordinateFrame:pointToObjectSpace(q)local V=ScreenSpace.AspectRatio()local d=math.tan(math.rad(Workspace.CurrentCamera.FieldOfView)/2)local u=V*d local U=(O.x/O.z)/-u local S=(O.y/O.z)/d return Vector2.new(ScreenSpace.ViewSizeX()*(.5+.5*U),ScreenSpace.ViewSizeY()*(.5+.5*S))end
-- WorldSpace -> ScreenSpace. Raw function taking a world position and giving you the
-- screen position.
function ScreenSpace.WorldToScreen(at)
	local point = Workspace.CurrentCamera.CoordinateFrame:pointToObjectSpace(at)
	local aspectRatio = ScreenSpace.AspectRatio()
	local hfactor = math.tan(math.rad(Workspace.CurrentCamera.FieldOfView) / 2)
	local wfactor = aspectRatio * hfactor
	--
	local x = (point.x / point.z) / -wfactor
	local y = (point.y / point.z) / hfactor
	--
	return Vector2.new(ScreenSpace.ViewSizeX() * (0.5 + 0.5 * x), ScreenSpace.ViewSizeY() * (0.5 + 0.5 * y))
end
