sm.areaTrigger.createAttachedCylinder

Creates an area trigger cylinder with a given size that stays attached to a Character

Kind: Function

Environments: Game

Game

Overload 1

sm.areaTrigger.createAttachedCylinder(
    character,
    radius,
    halfLength,
    position,
    rotation,
    filter,
    userdata,
    areaTriggerProxyType,
    boneName
)

Open the full Game reference

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.
radius number The radius of the cylinder.
halfLength number The lengthwise extent of the cylinder (i.e. half the length of the cylinder).
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.createAttachedCylinder(
    harvestable,
    radius,
    halfLength,
    position,
    rotation,
    filter,
    userdata,
    areaTriggerProxyType
)

Open the full Game reference

Creates an area trigger cylinder 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.
radius number The radius of the cylinder.
halfLength number The lengthwise extent of the cylinder (i.e. half the length of the cylinder).
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.createAttachedCylinder(
    shape,
    radius,
    halfLength,
    position,
    rotation,
    filter,
    userdata,
    areaTriggerProxyType,
    boneName
)

Open the full Game reference

Creates an area trigger cylinder 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
radius number The radius of the cylinder.
halfLength number The lengthwise extent of the cylinder (i.e. half the length of the cylinder).
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.createAttachedCylinder(
    interactable,
    radius,
    halfLength,
    position,
    rotation,
    filter,
    userdata,
    areaTriggerProxyType,
    boneName
)

Open the full Game reference

Creates an area trigger cylinder 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
radius number The radius of the cylinder.
halfLength number The lengthwise extent of the cylinder (i.e. half the length of the cylinder).
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.