# tag

> The tag of this game object.

## Definition

* **Type:** Property
* **Namespace:** [UnityEngine](/engine/6000.6/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public string tag { get; set; }
```

### Remarks

A tag can be used to identify a game object. Tags must be declared in the [Tags and Layers manager](/engine/6000.6/manual/unity-editor/editor-settings-reference/comp-manager-group/class-tag-manager.md) before using them.

**Note:** You should not set a tag from the [Awake()](/engine/6000.6/script-reference/unityengine/monobehaviour/awake.md) or [OnValidate()](/engine/6000.6/script-reference/unityengine/monobehaviour/onvalidate.md) method. This is because the order in which components become awake is not deterministic, and therefore can result in unexpected behaviour such as the tag being overwritten when it is awoken. If you try this, Unity will generate a warning reading "SendMessage cannot be called during Awake, CheckConsistency, or OnValidate".

### Examples

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    void Start()
    {
        // Prints the tag that this transform has
        Debug.Log("Transform Tag is: " + gameObject.tag);
    }
}
```
