# sm.areaTrigger.createAttachedHull

Creates an area trigger hull with a given size that stays attached to a [Character](../Game-Script-Environment/Userdata/Character.md)

**Kind:** Function

**Environments:** Game

## Game

### Overload 1

``` { .lua .api-signature }
sm.areaTrigger.createAttachedHull(
    character,
    hull,
    position?,
    rotation?,
    filter?,
    userdata?,
    areaTriggerProxyType?,
    boneName?
)
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/sm.areaTrigger.md#createattachedhull-character-string-vec3-optional-quat-optional-integer-optional-table-optional-integer-optional-string-optional)

If a filter is specified, the trigger area will only be able to detects objects of that certain type. See [sm.areaTrigger.filter](../Game-Script-Environment/Static-Functions/sm.areaTrigger.md#filter) for more information about filters.

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `character` | [Character](../Game-Script-Environment/Userdata/Character.md) | The host character. |
| `hull` | string | The path to the hull file. |
| `position` *(optional)* | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The position offset (Defaults to [sm.vec3.zero](../Game-Script-Environment/Static-Functions/sm.vec3.md#zero)) |
| `rotation` *(optional)* | [Quat](../Game-Script-Environment/Userdata/Quat.md) | The rotation offset (Defaults to [sm.quat.identity](../Game-Script-Environment/Static-Functions/sm.quat.md#identity)) |
| `filter` *(optional)* | integer | The object types the area trigger may detect. (See [sm.areaTrigger.filter](../Game-Script-Environment/Static-Functions/sm.areaTrigger.md#filter)). (Defaults to sm.areaTrigger.filter.all) |
| `userdata` *(optional)* | table | An optional table of user data |
| `areaTriggerProxyType` *(optional)* | integer | The proxy type of the area trigger. (See [sm.areaTrigger.areaTriggerProxyType](../Game-Script-Environment/Static-Functions/sm.areaTrigger.md#areatriggerproxytype)) (Defaults to sm.areaTrigger.areaTriggerProxyType.default) |
| `boneName` *(optional)* | string | The bone name of the character to attach the area trigger to. (optional) |

**Returns:**

| Type | Description |
| --- | --- |
| [AreaTrigger](../Game-Script-Environment/Userdata/AreaTrigger.md) | The created area trigger. |

### Overload 2

``` { .lua .api-signature }
sm.areaTrigger.createAttachedHull(
    harvestable,
    hull,
    position?,
    rotation?,
    filter?,
    userdata?,
    areaTriggerProxyType?
)
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/sm.areaTrigger.md#createattachedhull-harvestable-string-vec3-optional-quat-optional-integer-optional-table-optional-integer-optional)

Creates an area trigger hull with a given size that stays attached to an [Harvestable](../Game-Script-Environment/Userdata/Harvestable.md)

If a filter is specified, the trigger area will only be able to detects objects of that certain type. See [sm.areaTrigger.filter](../Game-Script-Environment/Static-Functions/sm.areaTrigger.md#filter) for more information about filters.

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `harvestable` | [Harvestable](../Game-Script-Environment/Userdata/Harvestable.md) | The host harvestable. |
| `hull` | string | The path to the hull file. |
| `position` *(optional)* | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The position offset (Defaults to [sm.vec3.zero](../Game-Script-Environment/Static-Functions/sm.vec3.md#zero)) |
| `rotation` *(optional)* | [Quat](../Game-Script-Environment/Userdata/Quat.md) | The rotation offset (Defaults to [sm.quat.identity](../Game-Script-Environment/Static-Functions/sm.quat.md#identity)) |
| `filter` *(optional)* | integer | The object types the area trigger may detect. (See [sm.areaTrigger.filter](../Game-Script-Environment/Static-Functions/sm.areaTrigger.md#filter)). (Defaults to sm.areaTrigger.filter.all) |
| `userdata` *(optional)* | table | An optional table of user data |
| `areaTriggerProxyType` *(optional)* | integer | The proxy type of the area trigger. (See [sm.areaTrigger.areaTriggerProxyType](../Game-Script-Environment/Static-Functions/sm.areaTrigger.md#areatriggerproxytype)) (Defaults to sm.areaTrigger.areaTriggerProxyType.default) |

**Returns:**

| Type | Description |
| --- | --- |
| [AreaTrigger](../Game-Script-Environment/Userdata/AreaTrigger.md) | The created area trigger. |

### Overload 3

``` { .lua .api-signature }
sm.areaTrigger.createAttachedHull(
    shape,
    hull,
    position?,
    rotation?,
    filter?,
    userdata?,
    areaTriggerProxyType?,
    boneName?
)
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/sm.areaTrigger.md#createattachedhull-shape-string-vec3-optional-quat-optional-integer-optional-table-optional-integer-optional-string-optional)

Creates an area trigger hull with a given size that stays attached to an [Shape](../Game-Script-Environment/Userdata/Shape.md)

If a filter is specified, the trigger area will only be able to detects objects of that certain type. See [sm.areaTrigger.filter](../Game-Script-Environment/Static-Functions/sm.areaTrigger.md#filter) for more information about filters.

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `shape` | [Shape](../Game-Script-Environment/Userdata/Shape.md) | The host shape |
| `hull` | string | The path to the hull file. |
| `position` *(optional)* | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The position offset (Defaults to [sm.vec3.zero](../Game-Script-Environment/Static-Functions/sm.vec3.md#zero)) |
| `rotation` *(optional)* | [Quat](../Game-Script-Environment/Userdata/Quat.md) | The rotation offset (Defaults to [sm.quat.identity](../Game-Script-Environment/Static-Functions/sm.quat.md#identity)) |
| `filter` *(optional)* | integer | The object types the area trigger may detect. (See [sm.areaTrigger.filter](../Game-Script-Environment/Static-Functions/sm.areaTrigger.md#filter)). (Defaults to sm.areaTrigger.filter.all) |
| `userdata` *(optional)* | table | An optional table of user data |
| `areaTriggerProxyType` *(optional)* | integer | The proxy type of the area trigger. (See [sm.areaTrigger.areaTriggerProxyType](../Game-Script-Environment/Static-Functions/sm.areaTrigger.md#areatriggerproxytype)) (Defaults to sm.areaTrigger.areaTriggerProxyType.default) |
| `boneName` *(optional)* | string | The bone name of the shape to attach the area trigger to. (optional) |

**Returns:**

| Type | Description |
| --- | --- |
| [AreaTrigger](../Game-Script-Environment/Userdata/AreaTrigger.md) | The created area trigger. |

### Overload 4

``` { .lua .api-signature }
sm.areaTrigger.createAttachedHull(
    interactable,
    hull,
    position?,
    rotation?,
    filter?,
    userdata?,
    areaTriggerProxyType?,
    boneName?
)
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/sm.areaTrigger.md#createattachedhull-interactable-string-vec3-optional-quat-optional-integer-optional-table-optional-integer-optional-string-optional)

Creates an area trigger hull with a given size that stays attached to an [Interactable](../Game-Script-Environment/Userdata/Interactable.md)

If a filter is specified, the trigger area will only be able to detects objects of that certain type. See [sm.areaTrigger.filter](../Game-Script-Environment/Static-Functions/sm.areaTrigger.md#filter) for more information about filters.

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `interactable` | [Interactable](../Game-Script-Environment/Userdata/Interactable.md) | The host interactable |
| `hull` | string | The path to the hull file. |
| `position` *(optional)* | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The position offset (Defaults to [sm.vec3.zero](../Game-Script-Environment/Static-Functions/sm.vec3.md#zero)) |
| `rotation` *(optional)* | [Quat](../Game-Script-Environment/Userdata/Quat.md) | The rotation offset (Defaults to [sm.quat.identity](../Game-Script-Environment/Static-Functions/sm.quat.md#identity)) |
| `filter` *(optional)* | integer | The object types the area trigger may detect. (See [sm.areaTrigger.filter](../Game-Script-Environment/Static-Functions/sm.areaTrigger.md#filter)). (Defaults to sm.areaTrigger.filter.all) |
| `userdata` *(optional)* | table | An optional table of user data |
| `areaTriggerProxyType` *(optional)* | integer | The proxy type of the area trigger. (See [sm.areaTrigger.areaTriggerProxyType](../Game-Script-Environment/Static-Functions/sm.areaTrigger.md#areatriggerproxytype)) (Defaults to sm.areaTrigger.areaTriggerProxyType.default) |
| `boneName` *(optional)* | string | The bone name of the interactable to attach the area trigger to. (optional) |

**Returns:**

| Type | Description |
| --- | --- |
| [AreaTrigger](../Game-Script-Environment/Userdata/AreaTrigger.md) | The created area trigger. |
