Setting UI element dimensions from world object/transform size

I have a screen space overlay UI Button that goes over an object that exists world space. I want the button to match the object’s size for any given resolution. I’m guessing I need to go from world to viewport but I can’t figure out the ratio.

I would simple put the Button on a Canvas with Render Mode World Space, child the canvas to the object in your scene and add a script to the Canvas containing the following line in the Update() loop:

    transform.LookAt(Camera.main.transform);