# IsComponentEnabled

> Checks whether a given ComponentType is enabled on the specified Entity.

## Definition

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

## IsComponentEnabled\<T>(Entity)

Checks whether a given [ComponentType](/engine/7000.0/script-reference/unity/entities/componenttype.md) is enabled on the specified [Entity](/engine/7000.0/script-reference/unity/entities/entity.md).

```csharp
public bool IsComponentEnabled<T>(Entity entity) where T : unmanaged, IEnableableComponent
```

### Parameters

**** (\[Entity]\(/engine/7000.0/script-reference/unity/entities/entity)): The entity whose component should be checked.

### Returns

| Type                                                          | Description                                                             |
| ------------------------------------------------------------- | ----------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the specified component is enabled, or false if it is disabled. |

### Remarks

An entity with a disabled component will not match an [EntityQuery](/engine/7000.0/script-reference/unity/entities/entityquery.md) that requires that component, and will match a query that excludes that component.

Additional Resources: [EntityManager.SetComponentEnabled](/engine/7000.0/script-reference/unity/entities/entitymanager/setcomponentenabled.md), [ComponentLookup\<T>.IsComponentEnabled](/engine/7000.0/script-reference/unity/entities/componentlookup1/iscomponentenabled.md)

## IsComponentEnabled\<T>(SystemHandle)

Checks whether a given [ComponentType](/engine/7000.0/script-reference/unity/entities/componenttype.md) is enabled on the specified system using [SystemHandle](/engine/7000.0/script-reference/unity/entities/systemhandle.md).

```csharp
public bool IsComponentEnabled<T>(SystemHandle systemHandle) where T : unmanaged, IEnableableComponent
```

### Parameters

**** (\[SystemHandle]\(/engine/7000.0/script-reference/unity/entities/systemhandle)): The system whose component should be checked.

### Returns

| Type                                                          | Description                                                             |
| ------------------------------------------------------------- | ----------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the specified component is enabled, or false if it is disabled. |

### Remarks

Additional Resources: [EntityManager.SetComponentEnabled](/engine/7000.0/script-reference/unity/entities/entitymanager/setcomponentenabled.md), [ComponentLookup\<T>.IsComponentEnabled](/engine/7000.0/script-reference/unity/entities/componentlookup1/iscomponentenabled.md)

## IsComponentEnabled(Entity, ComponentType)

Checks whether a given [ComponentType](/engine/7000.0/script-reference/unity/entities/componenttype.md) is enabled on the specified [Entity](/engine/7000.0/script-reference/unity/entities/entity.md).

```csharp
public bool IsComponentEnabled(Entity entity, ComponentType componentType)
```

### Parameters

**** (\[Entity]\(/engine/7000.0/script-reference/unity/entities/entity)): The entity whose component should be checked.**** (\[ComponentType]\(/engine/7000.0/script-reference/unity/entities/componenttype)): The component type to enable or disable. This type must implement the [IEnableableComponent](/engine/7000.0/script-reference/unity/entities/ienableablecomponent.md) interface.

### Returns

| Type                                                          | Description                                                             |
| ------------------------------------------------------------- | ----------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the specified component is enabled, or false if it is disabled. |

### Remarks

An entity with a disabled component will not match an [EntityQuery](/engine/7000.0/script-reference/unity/entities/entityquery.md) that requires that component, and will match a query that excludes that component.

Additional Resources: [EntityManager.SetComponentEnabled](/engine/7000.0/script-reference/unity/entities/entitymanager/setcomponentenabled.md), [ComponentLookup\<T>.IsComponentEnabled](/engine/7000.0/script-reference/unity/entities/componentlookup1/iscomponentenabled.md)
