# SetEnabled(Entity, bool)

> Adds or removes the Disabled component to an Entity.

## Definition

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

```csharp
public void SetEnabled(Entity entity, bool enabled)
```

### Parameters

**** (\[Entity]\(/engine/7000.0/script-reference/unity/entities/entity)): The entity to enable or disable**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): True if the entity should be enabled

### Remarks

Entities with the [Disabled](/engine/7000.0/script-reference/unity/entities/disabled.md) component are not matched by any [EntityQuery](/engine/7000.0/script-reference/unity/entities/entityquery.md), and are therefore not processed by systems. To override this behavior for a specific query, use EntityQueryOptions.IncludeDisabledEntities at query creation time.

If the entity was converted from a prefab and thus has a [LinkedEntityGroup](/engine/7000.0/script-reference/unity/entities/linkedentitygroup.md) component, the entire group will be enabled or disabled.

This operation requires a structural change to add or remove the [Disabled](/engine/7000.0/script-reference/unity/entities/disabled.md) component. To enable or disable individual components without requiring a structural change, see [IEnableableComponent](/engine/7000.0/script-reference/unity/entities/ienableablecomponent.md) and [EntityManager.SetComponentEnabled](/engine/7000.0/script-reference/unity/entities/entitymanager/setcomponentenabled.md).

Additional Resources: [EntityManager.IsEnabled](/engine/7000.0/script-reference/unity/entities/entitymanager/isenabled.md)
