sm.effect.playHostedEffect

Plays an effect. It will fetch position, velocity and orientation data from the host interactable.

Kind: Function

Environments: Game

Game

Overload 1

sm.effect.playHostedEffect(
    name,
    interactable,
    boneName,
    parameters,
    axis,
    startTime,
    offsetPosition,
    offsetRotation,
    scale
)

Open the full Game reference

Availability: Client only

Note: If you start a looping effect using this function you will not be able to stop it.
Please use createEffect for looping effects

Parameters:

Name Type Description
name string The effect name.
interactable Interactable The interactable the effect is attached to.
boneName (optional) string The bone name. (Optional)
parameters (optional) table The table containing the parameters for the effect. (Optional)
axis (optional) integer The axis of which the effect will ignore the hosts rotation around. (Defaults to sm.effect.axis.none) (Optional)
startTime (optional) number The initial time progression of the effect. Can be used to fast forward some effect parts. Can be used to delay effect part activation if negative.
offsetPosition (optional) Vec3 The host object relative offset position. (Defaults to sm.vec3.zero())
offsetRotation (optional) Quat The host object relative offset rotation. (Defaults to sm.quat.identity())
scale (optional) Vec3 The scale, only applied to renderables. (Defaults to sm.vec3.one())

Overload 2

sm.effect.playHostedEffect(
    name,
    shape,
    boneName,
    parameters,
    axis,
    startTime,
    offsetPosition,
    offsetRotation,
    scale
)

Open the full Game reference

Availability: Client only

Plays an effect. It will fetch position, velocity and orientation data from the host shape.

Note: If you start a looping effect using this function you will not be able to stop it.
Please use createEffect for looping effects

Parameters:

Name Type Description
name string The effect name.
shape Shape The shape the effect is attached to.
boneName (optional) string The bone name. (Optional)
parameters (optional) table The table containing the parameters for the effect. (Optional)
axis (optional) integer The axis of which the effect will ignore the hosts rotation around. (Defaults to sm.effect.axis.none) (Optional)
startTime (optional) number The initial time progression of the effect. Can be used to fast forward some effect parts. Can be used to delay effect part activation if negative.
offsetPosition (optional) Vec3 The host object relative offset position. (Defaults to sm.vec3.zero())
offsetRotation (optional) Quat The host object relative offset rotation. (Defaults to sm.quat.identity())
scale (optional) Vec3 The scale, only applied to renderables. (Defaults to sm.vec3.one())

Overload 3

sm.effect.playHostedEffect(
    name,
    harvestable,
    boneName,
    parameters,
    axis,
    startTime,
    offsetPosition,
    offsetRotation,
    scale
)

Open the full Game reference

Availability: Client only

Plays an effect. It will fetch position, velocity and orientation data from the host harvestable.

Note: If you start a looping effect using this function you will not be able to stop it.
Please use createEffect for looping effects

Parameters:

Name Type Description
name string The effect name.
harvestable Harvestable The harvestable the effect is attached to.
boneName (optional) string The bone name. (Optional)
parameters (optional) table The table containing the parameters for the effect. (Optional)
axis (optional) integer The axis of which the effect will ignore the hosts rotation around. (Defaults to sm.effect.axis.none) (Optional)
startTime (optional) number The initial time progression of the effect. Can be used to fast forward some effect parts. Can be used to delay effect part activation if negative.
offsetPosition (optional) Vec3 The host object relative offset position. (Defaults to sm.vec3.zero())
offsetRotation (optional) Quat The host object relative offset rotation. (Defaults to sm.quat.identity())
scale (optional) Vec3 The scale, only applied to renderables. (Defaults to sm.vec3.one())

Overload 4

sm.effect.playHostedEffect(
    name,
    character,
    boneName,
    parameters,
    axis,
    startTime,
    offsetPosition,
    offsetRotation,
    scale
)

Open the full Game reference

Availability: Client only

Plays an effect. It will fetch position, velocity and orientation data from the host character.

Note: If you start a looping effect using this function you will not be able to stop it.
Please use createEffect for looping effects

Parameters:

Name Type Description
name string The effect name.
character Character The character the effect is attached to.
boneName (optional) string The bone name. (Optional)
parameters (optional) table The table containing the parameters for the effect. (Optional)
axis (optional) integer The axis of which the effect will ignore the hosts rotation around. (Defaults to sm.effect.axis.none) (Optional)
startTime (optional) number The initial time progression of the effect. Can be used to fast forward some effect parts. Can be used to delay effect part activation if negative.
offsetPosition (optional) Vec3 The host object relative offset position. (Defaults to sm.vec3.zero())
offsetRotation (optional) Quat The host object relative offset rotation. (Defaults to sm.quat.identity())
scale (optional) Vec3 The scale, only applied to renderables. (Defaults to sm.vec3.one())