sm.effect.createEffect
Creates an effect.
Kind: Function
Environments: Game
Game
Overload 1
sm.effect.createEffect( name )
Availability: Client only
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | The name. |
Returns:
| Type | Description |
|---|---|
| Effect | The created effect. |
Overload 2
sm.effect.createEffect( name, interactable, boneName, axis )
Availability: Client only
If you provide a host interactable to the effect then it will fetch position, velocity and orientation data from the interactable instead of relying on this information being fed to it.
This results in far more accurate positioning of effects that are supposed to stay attached to an object.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | The name. |
interactable |
Interactable | The interactable the effect is attached to. |
boneName (optional) |
string | Bone name to attach effect to. (Defaults to not attached to a bone) (Optional) |
axis (optional) |
integer | The axis of which the effect will ignore the hosts rotation around. (Defaults to sm.effect.axis.none) (Optional) |
Returns:
| Type | Description |
|---|---|
| Effect | The created effect. |
Overload 3
sm.effect.createEffect( name, shape, boneName, axis )
Availability: Client only
If you provide a host shape to the effect then it will fetch position, velocity and orientation data from the shape instead of relying on this information being fed to it.
This results in far more accurate positioning of effects that are supposed to stay attached to an object.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | The name. |
shape |
Shape | The shape the effect is attached to. |
boneName (optional) |
string | Bone name to attach effect to. (Defaults to not attached to a bone) (Optional) |
axis (optional) |
integer | The axis of which the effect will ignore the hosts rotation around. (Defaults to sm.effect.axis.none) (Optional) |
Returns:
| Type | Description |
|---|---|
| Effect | The created effect. |
Overload 4
sm.effect.createEffect( name, harvestable, axis )
Availability: Client only
If you provide a host harvestable to the effect then it will fetch position, velocity and orientation data from the harvestable instead of relying on this information being fed to it.
This results in far more accurate positioning of effects that are supposed to stay attached to an object.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | The name. |
harvestable |
Harvestable | The harvestable the effect is attached to. |
axis (optional) |
integer | The axis of which the effect will ignore the hosts rotation around. (Defaults to sm.effect.axis.none) (Optional) |
Returns:
| Type | Description |
|---|---|
| Effect | The created effect. |
Overload 5
sm.effect.createEffect( name, character, boneName, axis )
Availability: Client only
If you provide a host character to the effect then it will fetch position, velocity and orientation data from the character instead of relying on this information being fed to it.
This results in far more accurate positioning of effects that are supposed to stay attached to an object.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | The name. |
character |
Character | The character the effect is attached to. |
boneName (optional) |
string | Bone name to attach effect to. (Defaults to not attached to a bone) (Optional) |
axis (optional) |
integer | The axis of which the effect will ignore the hosts rotation around. (Defaults to sm.effect.axis.none) (Optional) |
Returns:
| Type | Description |
|---|---|
| Effect | The created effect. |