# GetSingleton<T>()

> Gets the value of a singleton component.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule

```csharp
public static T GetSingleton<T>() where T : unmanaged, IComponentData
```

### Returns

| Type | Description    |
| ---- | -------------- |
| T    | The component. |

### Remarks

Not working in Entities.ForEach, IJobEntity, and Utility methods

Additional Resources: [ComponentSystemBase.GetSingletonRW](/engine/7000.0/script-reference/unity/entities/componentsystembase/getsingletonrw.md), [EntityQuery.GetSingleton](/engine/7000.0/script-reference/unity/entities/entityquery/getsingleton.md), [EntityQuery.GetSingletonRW](/engine/7000.0/script-reference/unity/entities/entityquery/getsingletonrw.md)
