# WithAnyChunkComponent<T>()

> Add an optional read-only chunk component type to the query.

## Definition

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

```csharp
public EntityQueryBuilder WithAnyChunkComponent<T>()
```

### Returns

| Type                                                                                       | Description                                  |
| ------------------------------------------------------------------------------------------ | -------------------------------------------- |
| [EntityQueryBuilder](/engine/7000.0/script-reference/unity/entities/entityquerybuilder.md) | The builder object that invoked this method. |

### Remarks

To match the resulting query, an Entity must have at least one of the query's optional component types, specified using either [EntityQueryBuilder.WithAny](/engine/7000.0/script-reference/unity/entities/entityquerybuilder/withany.md) or [EntityQueryBuilder.WithAnyChunkComponent](/engine/7000.0/script-reference/unity/entities/entityquerybuilder/withanychunkcomponent.md). Chunk components are a distinct component type, which are different from adding the same type as a standard component.

Compare this to WithAllChunkComponent@@@@1

To add additional optional Chunk Components, call this method multiple times.

To add component types that are not known at compile time, use EntityQueryBuilder.WithAny@@\<c>1(\</c>@@0)

The query will request read-only access to the referenced component(s). To request read/write access, use EntityQueryBuilder.WithAnyChunkComponentRW@@\<c>1(\</c>@@0)
