# RemoveComponent

> Removes multiple components from a specified colleciton of entities.

## Definition

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

## RemoveComponent(NativeArray\<Entity>, ComponentTypeSet)

Removes multiple components from a specified colleciton of entities.

```csharp
public void RemoveComponent(NativeArray<Entity> entities, in ComponentTypeSet componentTypeSet)
```

### Parameters

**** (\[NativeArray\<Entity>]\(/engine/7000.0/script-reference/unity/collections/nativearray1)): The collection of entities to modify.**** (\[ComponentTypeSet]\(/engine/7000.0/script-reference/unity/entities/componenttypeset)): The types of components to remove.

### Remarks

You can use this method to remove a component from an Entity

It's OK if some or all of the components to remove are already missing from the entity.

Removing components changes an entity's archetype and results in the entity being moved to a different chunk.

**Important:** This method creates a sync point, which means that the EntityManager waits for all currently running jobs to complete before removing the component. No additional jobs can start before the method is finished. A sync point can cause a drop in performance because the ECS framework might not be able to use the processing power of all available cores.

## RemoveComponent(NativeArray\<Entity>, ComponentType)

Remove a component from a set of entities.

```csharp
public void RemoveComponent(NativeArray<Entity> entities, ComponentType componentType)
```

### Parameters

**** (\[NativeArray\<Entity>]\(/engine/7000.0/script-reference/unity/collections/nativearray1)): An array of Entity objects.**** (\[ComponentType]\(/engine/7000.0/script-reference/unity/entities/componenttype)): The type of component to remove.

### Remarks

Can remove any kind of component.

Removing a component changes an entity's archetype and results in the entity being moved to a different chunk.

**Important:** This method creates a sync point, which means that the EntityManager waits for all currently running jobs to complete before creating the chunk. No additional jobs can start before the method is finished. A sync point can cause a drop in performance because the ECS framework might not be able to use the processing power of all available cores.

## RemoveComponent(Entity, ComponentType)

Removes a component from an entity.

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

### Parameters

**** (\[Entity]\(/engine/7000.0/script-reference/unity/entities/entity)): The entity to modify.**** (\[ComponentType]\(/engine/7000.0/script-reference/unity/entities/componenttype)): The type of component to remove.

### Returns

| Type                                                          | Description                                     |
| ------------------------------------------------------------- | ----------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the component was removed successfully. |

### Remarks

Can remove any kind of component.

Returns false if the entity already does not have the specified component, or if the entity does not exist.

Removing a component changes an entity's archetype and results in the entity being moved to a different chunk.

**Important:** This method creates a sync point, which means that the EntityManager waits for all currently running jobs to complete before removing the component. No additional jobs can start before the method is finished. A sync point can cause a drop in performance because the ECS framework might not be able to use the processing power of all available cores.

## RemoveComponent(SystemHandle, ComponentType)

Removes a component from an entity associated with a system.

```csharp
public bool RemoveComponent(SystemHandle system, ComponentType componentType)
```

### Parameters

**** (\[SystemHandle]\(/engine/7000.0/script-reference/unity/entities/systemhandle)): The system handle.**** (\[ComponentType]\(/engine/7000.0/script-reference/unity/entities/componenttype)): The type of component to remove.

### Returns

| Type                                                          | Description                                     |
| ------------------------------------------------------------- | ----------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the component was removed successfully. |

### Remarks

Can remove any kind of component.

Returns false if the entity already does not have the specified component, or if the entity does not exist.

Removing a component changes an entity's archetype and results in the entity being moved to a different chunk.

**Important:** This method creates a sync point, which means that the EntityManager waits for all currently running jobs to complete before removing the component. No additional jobs can start before the method is finished. A sync point can cause a drop in performance because the ECS framework might not be able to use the processing power of all available cores.

## RemoveComponent(Entity, ComponentTypeSet)

Removes multiple components from an entity.

```csharp
public void RemoveComponent(Entity entity, in ComponentTypeSet componentTypeSet)
```

### Parameters

**** (\[Entity]\(/engine/7000.0/script-reference/unity/entities/entity)): The entity to modify.**** (\[ComponentTypeSet]\(/engine/7000.0/script-reference/unity/entities/componenttypeset)): The types of components to remove.

### Remarks

You can use this method to remove a component from an Entity

It's OK if some or all of the components to remove are already missing from the entity, or if the target entity does not exist.

Removing components changes an entity's archetype and results in the entity being moved to a different chunk.

**Important:** This method creates a sync point, which means that the EntityManager waits for all currently running jobs to complete before removing the component. No additional jobs can start before the method is finished. A sync point can cause a drop in performance because the ECS framework might not be able to use the processing power of all available cores.

## RemoveComponent(EntityQuery, ComponentType)

Removes a component from a set of entities defined by an EntityQuery.

```csharp
public void RemoveComponent(EntityQuery entityQuery, ComponentType componentType)
```

### Parameters

**** (\[EntityQuery]\(/engine/7000.0/script-reference/unity/entities/entityquery)): The EntityQuery defining the entities to modify.**** (\[ComponentType]\(/engine/7000.0/script-reference/unity/entities/componenttype)): The type of component to remove.

### Remarks

Can remove any kind of component.

It's OK if some or all of the components to remove are already missing from some or all of the entities.

Removing a component changes an entity's archetype and results in the entity being moved to a different chunk.

**Important:** This method creates a sync point, which means that the EntityManager waits for all currently running jobs to complete before removing the component. No additional jobs can start before the method is finished. A sync point can cause a drop in performance because the ECS framework might not be able to use the processing power of all available cores.

## RemoveComponent(EntityQuery, ComponentTypeSet)

Removes a set of components from a set of entities defined by an EntityQuery.

```csharp
public void RemoveComponent(EntityQuery entityQuery, in ComponentTypeSet componentTypeSet)
```

### Parameters

**** (\[EntityQuery]\(/engine/7000.0/script-reference/unity/entities/entityquery)): The EntityQuery defining the entities to modify.**** (\[ComponentTypeSet]\(/engine/7000.0/script-reference/unity/entities/componenttypeset)): The types of components to add.

### Remarks

You can use this method to remove a component from an Entity

It's OK if some or all of the components to remove are already missing from some or all of the entities.

Removing a component changes an entity's archetype and results in the entity being moved to a different chunk.

**Important:** This method creates a sync point, which means that the EntityManager waits for all currently running jobs to complete before removing the component. No additional jobs can start before the method is finished. A sync point can cause a drop in performance because the ECS framework might not be able to use the processing power of all available cores.

## RemoveComponent\<T>(Entity)

Removes a component from an entity.

```csharp
public bool RemoveComponent<T>(Entity entity)
```

### Parameters

**** (\[Entity]\(/engine/7000.0/script-reference/unity/entities/entity)): The entity.

### Returns

| Type                                                          | Description                                     |
| ------------------------------------------------------------- | ----------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the component was removed successfully. |

### Remarks

Can remove any kind of component except chunk components.

Returns false if the entity was already missing the component.

Removing a component changes an entity's archetype and results in the entity being moved to a different chunk.

**Important:** This method creates a sync point, which means that the EntityManager waits for all currently running jobs to complete before removing the component. No additional jobs can start before the method is finished. A sync point can cause a drop in performance because the ECS framework might not be able to use the processing power of all available cores.

## RemoveComponent\<T>(SystemHandle)

Removes a component from an entity associated with a system.

```csharp
public bool RemoveComponent<T>(SystemHandle system)
```

### Parameters

**** (\[SystemHandle]\(/engine/7000.0/script-reference/unity/entities/systemhandle)): The system handle.

### Returns

| Type                                                          | Description                                     |
| ------------------------------------------------------------- | ----------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the component was removed successfully. |

### Remarks

Can remove any kind of component except chunk components.

Returns false if the entity was already missing the component.

Removing a component changes an entity's archetype and results in the entity being moved to a different chunk.

**Important:** This method creates a sync point, which means that the EntityManager waits for all currently running jobs to complete before removing the component. No additional jobs can start before the method is finished. A sync point can cause a drop in performance because the ECS framework might not be able to use the processing power of all available cores.

## RemoveComponent\<T>(EntityQuery)

Removes a component from a set of entities defined by a EntityQuery.

```csharp
public void RemoveComponent<T>(EntityQuery entityQuery)
```

### Parameters

**** (\[EntityQuery]\(/engine/7000.0/script-reference/unity/entities/entityquery)): The EntityQuery defining the entities to modify.

### Remarks

Can remove any kind of component except chunk components.

It's OK if the component to remove is already missing from some or all of the entities.

Removing a component changes an entity's archetype and results in the entity being moved to a different chunk.

**Important:** This method creates a sync point, which means that the EntityManager waits for all currently running jobs to complete before removing the component. No additional jobs can start before the method is finished. A sync point can cause a drop in performance because the ECS framework might not be able to use the processing power of all available cores.

## RemoveComponent\<T>(NativeArray\<Entity>)

Removes a component from a set of entities.

```csharp
public void RemoveComponent<T>(NativeArray<Entity> entities)
```

### Parameters

**** (\[NativeArray\<Entity>]\(/engine/7000.0/script-reference/unity/collections/nativearray1)): An array identifying the entities to modify.

### Remarks

Can remove any kind of component except chunk components.

It's OK if the component to remove is already missing from some or all of the entities.

Removing a component changes an entity's archetype and results in the entity being moved to a different chunk.

**Important:** This method creates a sync point, which means that the EntityManager waits for all currently running jobs to complete before removing the component. No additional jobs can start before the method is finished. A sync point can cause a drop in performance because the ECS framework might not be able to use the processing power of all available cores.
