sm.areaTrigger.createAttachedBox
Creates an area trigger box with a given size that stays attached to an Character
Kind: Function
Environments: Game
Game
Overload 1
sm.areaTrigger.createAttachedBox(
character,
dimension,
position,
rotation,
filter,
userdata,
areaTriggerProxyType,
boneName
)
If a filter is specified, the trigger area will only be able to detects objects of that certain type. See sm.areaTrigger.filter for more information about filters.
Parameters:
| Name | Type | Description |
|---|---|---|
character |
Character | The host character. |
dimension |
Vec3 | The size of the box |
position (optional) |
Vec3 | The position offset (Defaults to sm.vec3.zero) |
rotation (optional) |
Quat | The rotation offset (Defaults to sm.quat.identity) |
filter (optional) |
integer | The object types the area trigger may detect. (See sm.areaTrigger.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) (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 | The created area trigger. |
Overload 2
sm.areaTrigger.createAttachedBox(
harvestable,
dimension,
position,
rotation,
filter,
userdata,
areaTriggerProxyType
)
Creates an area trigger box with a given size that stays attached to an Harvestable
If a filter is specified, the trigger area will only be able to detects objects of that certain type. See sm.areaTrigger.filter for more information about filters.
Parameters:
| Name | Type | Description |
|---|---|---|
harvestable |
Harvestable | The host harvestable. |
dimension |
Vec3 | The size of the box |
position (optional) |
Vec3 | The position offset (Defaults to sm.vec3.zero) |
rotation (optional) |
Quat | The rotation offset (Defaults to sm.quat.identity) |
filter (optional) |
integer | The object types the area trigger may detect. (See sm.areaTrigger.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) (Defaults to sm.areaTrigger.areaTriggerProxyType.default) |
Returns:
| Type | Description |
|---|---|
| AreaTrigger | The created area trigger. |
Overload 3
sm.areaTrigger.createAttachedBox(
shape,
dimension,
position,
rotation,
filter,
userdata,
areaTriggerProxyType,
boneName
)
Creates an area trigger box with a given size that stays attached to an Shape
If a filter is specified, the trigger area will only be able to detects objects of that certain type. See sm.areaTrigger.filter for more information about filters.
Parameters:
| Name | Type | Description |
|---|---|---|
shape |
Shape | The host shape |
dimension |
Vec3 | The size of the box |
position (optional) |
Vec3 | The position offset (Defaults to sm.vec3.zero) |
rotation (optional) |
Quat | The rotation offset (Defaults to sm.quat.identity) |
filter (optional) |
integer | The object types the area trigger may detect. (See sm.areaTrigger.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) (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 | The created area trigger. |
Overload 4
sm.areaTrigger.createAttachedBox(
interactable,
dimension,
position,
rotation,
filter,
userdata,
areaTriggerProxyType,
boneName
)
Creates an area trigger box with a given size that stays attached to an Interactable
If a filter is specified, the trigger area will only be able to detects objects of that certain type. See sm.areaTrigger.filter for more information about filters.
Parameters:
| Name | Type | Description |
|---|---|---|
interactable |
Interactable | The host interactable |
dimension |
Vec3 | The size of the box |
position (optional) |
Vec3 | The position offset (Defaults to sm.vec3.zero) |
rotation (optional) |
Quat | The rotation offset (Defaults to sm.quat.identity) |
filter (optional) |
integer | The object types the area trigger may detect. (See sm.areaTrigger.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) (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 | The created area trigger. |