# SetComponentEnabled(Entity, bool)

> Obsolete. Use BufferLookup<T>.SetBufferEnabled instead.

## Definition

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

> **Warning:**
>
> **Deprecated.** Use SetBufferEnabled (RemovedAfter: Entities pre-1.0)

```csharp
public void SetComponentEnabled(Entity entity, bool value)
```

### Parameters

**** (\[Entity]\(/engine/7000.0/script-reference/unity/entities/entity)): The entity whose component should be enabled or disabled.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): True if the specified component should be enabled, or false if it should be disabled.

### Remarks

**Obsolete.** Use [BufferLookup\<T>.SetBufferEnabled](/engine/7000.0/script-reference/unity/entities/bufferlookup1/setbufferenabled.md) instead.

Enable or disable the [IBufferElementData](/engine/7000.0/script-reference/unity/entities/ibufferelementdata.md) of type T on the specified [Entity](/engine/7000.0/script-reference/unity/entities/entity.md). This operation does not cause a structural change (even if it occurs on a worker thread), or affect the value of the component. For the purposes of EntityQuery matching, an entity with a disabled component will behave as if it does not have that component. The type T must implement the [IEnableableComponent](/engine/7000.0/script-reference/unity/entities/ienableablecomponent.md) interface.

Additional Resources: [BufferLookup\<T>.IsBufferEnabled](/engine/7000.0/script-reference/unity/entities/bufferlookup1/isbufferenabled.md)
