> For the complete documentation index, see [llms.txt](https://akila.gitbook.io/fps-framework/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://akila.gitbook.io/fps-framework/tutorials/ui/get-name.md).

# Get Name

Get Name is an easy-to-use component that makes creating and managing large UIs and menus a lot easier without having to change each text manually. It takes the value of the[ transform name](https://docs.unity3d.com/ScriptReference/Object-name.html) to the given text element.

### **Fields**

<table><thead><tr><th width="126">Name</th><th>Description</th></tr></thead><tbody><tr><td>Target</td><td>Target object that the component will take the name from, settings this to any object will update the text to that object's name</td></tr></tbody></table>

## Setup with [text](https://docs.unity3d.com/2018.3/Documentation/ScriptReference/UI.Text.html)

To add the component, first create a new button by hovering your mouse cursor over any empty space and access the create menu by clicking on **UI,** then **Legecy,** then **Button.**

<figure><img src="/files/atZtlVc77xscII8PAsRr" alt=""><figcaption><p>Create button menu</p></figcaption></figure>

Now that you have created a legacy button, expand the button and add the component **GetName** to the text inside of your button. After adding the component, the text should be equal to the target object's name.

<figure><img src="/files/68s2CBE1AxgE3w7sXdrv" alt=""><figcaption></figcaption></figure>

## Setup with [text mesh pro](https://docs.unity3d.com/Manual/com.unity.textmeshpro.html)

To add the component, first create a new button by hovering your mouse cursor over any empty space in the hierarchy, and then click on the menu **UI,** then click on the item **Button - TextMeshPro** like this:

<figure><img src="/files/M23oL88yz5uhT1UscACa" alt=""><figcaption><p>Create Text Mesh Pro Button menu</p></figcaption></figure>

Now that you've created a button, expand the button and add the component **GetName** to the text mesh pro inside of your button. After adding the component, the text should be equal to the target object's name.

<figure><img src="/files/agjsz8inKWuH7TV3k2ym" alt=""><figcaption></figcaption></figure>
