# GetSingleton<T>()

> Gets the value of a singleton component. Note that if querying a singleton component from a system-associated entity, the query must include either EntityQueryOptions.IncludeSystems or the SystemInstance component.

## Definition

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

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

### Returns

| Type | Description                        |
| ---- | ---------------------------------- |
| T    | A copy of the singleton component. |

### Remarks

A singleton component is a component of which only one instance exists that satisfies this query.

Additional Resources: [EntityQuery.SetSingleton](/engine/7000.0/script-reference/unity/entities/entityquery/setsingleton.md), [EntityQuery.GetSingletonEntity](/engine/7000.0/script-reference/unity/entities/entityquery/getsingletonentity.md), [EntityQuery.GetSingletonBuffer](/engine/7000.0/script-reference/unity/entities/entityquery/getsingletonbuffer.md), [ComponentSystemBase.GetSingleton](/engine/7000.0/script-reference/unity/entities/componentsystembase/getsingleton.md)
