How to attach labels to objects

Hi,

I am trying to attach labels to objects with a line coming from objects to label… Attached sample81711-labels.png for reference…

Please find attachment for your reference the labels are not clear sorry about that… I am actually designing a game that needs this type of labeling. Is there a way so that I can do that thing out…Please help me out.

Create the boxes using the UI system and the LineRenderer to define the transform and target position between UI box and e.g an empty gameobject positioned on the body.

LineRenderer.SetPosition(0, transform.position);
LineRenderer.SetPosition(1, target.position);

Some references:

https://forum.unity3d.com/threads/how-to-draw-lines-between-two-gameobjects.121962/