- Home /
How to attach labels to objects
Hi,
I am trying to attach labels to objects with a line coming from objects to label..... Attached sample 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.
Hi. Did you find any solution because i am facing same problem and I don't have any idea how to do it exactly.
Answer by ForeignGod · Nov 07, 2016 at 10:08 AM
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/ https://docs.unity3d.com/ScriptReference/LineRenderer.SetPosition.html
Your answer
![](https://koobas.hobune.stream/wayback/20220612100220im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
positioning gui! 2 Answers
Help labeling a 3d object 1 Answer
What is that And How to use it? 1 Answer
Addressables: How to get a list of labels from loaded asset? 0 Answers