# GetComponent<T>()

> Returns a component of type T. For PlayerSettings, returns the global fallback if no PlayerSettings component is found. Returns null if the component isn't available.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.Build.Profile](/engine/6000.7/script-reference/unityeditor/build/profile.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public T GetComponent<T>() where T : Object
```

### Returns

| Type | Description                                                                                                                                                                                                                        |
| ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| T    | Settings component type to fetch. Expects a [ScriptableObject](/engine/6000.7/script-reference/unityengine/scriptableobject.md) implementation or [PlayerSettings](/engine/6000.7/script-reference/unityeditor/playersettings.md). |

### Remarks

**Note**: This function is restricted to [ScriptableObject](/engine/6000.7/script-reference/unityengine/scriptableobject.md) types or [PlayerSettings](/engine/6000.7/script-reference/unityeditor/playersettings.md).
