Render Bounds to Screen Rect

I was wondering if it was possible to get a GameObject’s bounds as a rectangle on the screen. For example, this could be used to surround a character with GUI elements. There’s the WorldToScreenPoint method, but that only seems helpful in trying to get the objects pivot point to screen point causing GUI to sit on top of something instead of right outside something.

Hmmm…

OK, theory… You have an object with a render bounds. This object has a center and extents. Hold a min and max and go through all 8 points of the bounds (bounds.center-extents…), and get their WorldToScreenPoint. Test those against the min and max. Ultimately, you will get a Min and Max location for your rectangle. I don’t know if this will give you what you want, but it should be close.