# TryGetSingleton<T>(out T)

> Gets the value of a singleton component, and returns whether or not a singleton component of the specified type exists in the ComponentSystemBase.World.

## Definition

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

## TryGetSingleton\<T>(T)

> **Warning:**
>
> **Deprecated.** Use SystemAPI.TryGetSingleton instead (RemovedAfter Entities 1.0)

```csharp
public bool TryGetSingleton<T>(out T value) where T : unmanaged, IComponentData
```

### Parameters

**** (T): The component. if an [Entity](/engine/7000.0/script-reference/unity/entities/entity.md) with the specified type does not exist in the [ComponentSystemBase.World](/engine/7000.0/script-reference/unity/entities/componentsystembase/world.md), this is assigned a default value

### Returns

| Type                                                          | Description                                                                                                                                                                                                                                      |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True, if exactly one [Entity](/engine/7000.0/script-reference/unity/entities/entity.md) exists in the [ComponentSystemBase.World](/engine/7000.0/script-reference/unity/entities/componentsystembase/world.md) with the provided component type. |
