# GetComponent<T>()

> Returns the component of type T if the GameObject of the tile map has one attached, null if it doesn't.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Tilemaps](/engine/6000.5/script-reference/unityengine/tilemaps.md)
* **Assembly:** UnityEngine.TilemapModule

```csharp
public T GetComponent<T>()
```

### Returns

| Type | Description                          |
| ---- | ------------------------------------ |
| T    | The Component of type T to retrieve. |
