# Unit.getContainer

Returns the container stored in the given index inside the unit.

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
unit:getContainer( index? )
```

[Open the full Game reference](../Game-Script-Environment/Userdata/Unit.md#getcontainer)

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `unit` | [Unit](../Game-Script-Environment/Userdata/Unit.md) | The unit. |
| `index` *(optional)* | integer | The index of the container (default: 0). |

**Returns:**

| Type | Description |
| --- | --- |
| [Container](../Game-Script-Environment/Userdata/Container.md) | The container. |
