# 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="https://512600823-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLQgz9gGwkU5HhRwKT3te%2Fuploads%2F6fAhwQ6A5J4F6f0AKrXy%2FScreenshot%202023-12-29%20173310.png?alt=media&#x26;token=48d332ae-6af5-4648-a45a-4bb86e25ccac" 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="https://512600823-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLQgz9gGwkU5HhRwKT3te%2Fuploads%2FYjkKW5f6cyLxeXwPYZUh%2FScreenshot%202023-12-29%20173641.png?alt=media&#x26;token=be530e47-a5c5-47f2-ae9a-e29bad1fbebd" 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="https://512600823-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLQgz9gGwkU5HhRwKT3te%2Fuploads%2FBKPHG8kRxDKBgMNbYeXF%2FScreenshot%202023-12-29%20174007.png?alt=media&#x26;token=85491c09-0e56-46df-9721-af30b62f078e" 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="https://512600823-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLQgz9gGwkU5HhRwKT3te%2Fuploads%2FkFTTopkTgWcxH6D8M1jP%2FScreenshot%202023-12-29%20174211.png?alt=media&#x26;token=72690de6-cdfb-41f3-adf8-a5bd012bf223" alt=""><figcaption></figcaption></figure>
