# TryGetSingletonEntity<T>(out Entity)

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

## Definition

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

## TryGetSingletonEntity\<T>(Entity)

```csharp
public static bool TryGetSingletonEntity<T>(out Entity value) where T : unmanaged
```

### Parameters

**** (\[Entity]\(/engine/7000.0/script-reference/unity/entities/entity)): The [Entity](/engine/7000.0/script-reference/unity/entities/entity.md) associated with the specified singleton component. If a singleton of the specified types does not exist in the current [World](/engine/7000.0/script-reference/unity/entities/world.md), this is set to Entity.Null

### 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 [World](/engine/7000.0/script-reference/unity/entities/world.md) with the provided component type. |

### Remarks

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