# GetComponentBoxed

> Gets the component object of a given entity

## Definition

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

## GetComponentBoxed(Entity, ComponentType)

Gets the component object of a given entity

```csharp
public object GetComponentBoxed(Entity entity, ComponentType type)
```

### Parameters

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

### Returns

| Type                                                           | Description          |
| -------------------------------------------------------------- | -------------------- |
| [Object](https://learn.microsoft.com/dotnet/api/system.object) | The component object |

## GetComponentBoxed(Entity, Type)

Gets the component object of a given entity based on the type

```csharp
public object GetComponentBoxed(Entity entity, Type type)
```

### Parameters

**** (\[Entity]\(/engine/7000.0/script-reference/unity/entities/entity)): The entity**** (\[Type]\(https\://learn.microsoft.com/dotnet/api/system.type)): The type to get the object of

### Returns

| Type                                                           | Description          |
| -------------------------------------------------------------- | -------------------- |
| [Object](https://learn.microsoft.com/dotnet/api/system.object) | The component object |
