sm.physics.explode
Creates an explosion at given position. The explosion creates a shockwave that is capable of destroying blocks and pushing characters and creations away.
Kind: Function
Environments: Game
Game
sm.physics.explode(
position,
level,
destructionRadius,
impulseRadius,
magnitude,
effectName,
ignoreShape,
parameters,
world,
damage,
source,
type
)
Availability: Server only
Shapes that are within the explosion's destruction radius may receive the event server_onExplosionHit.
Note: The destruction level is the damage effect on blocks and parts, determining how likely it is that they are destroyed. This is related to the
qualityLevelfound in parts json-files. Any quality level equal to or less than the destruction level may be destroyed. The effect fades one level every half travelled of the remaining destruction radius. A quality level of 0 means a block or part is indestructible.
Parameters:
| Name | Type | Description |
|---|---|---|
position |
Vec3 | The center point of the explosion. |
level |
integer | The destruction level affecting nearby objects. |
destructionRadius |
number | The destruction radius. Objects inside this sphere may be destroyed. |
impulseRadius |
number | The impulse radius. Objects inside this sphere are affected by an impulse. |
magnitude |
number | The impulse strength of the explosion. The strength diminishes with distance. |
effectName (optional) |
string | The name of the effect to be played upon explosion. (Optional) |
ignoreShape (optional) |
Shape | The shape to be ignored. (Optional) |
parameters (optional) |
table | The table containing the parameters for the effect. (Optional) |
world (optional) |
World | The world to cause the explosion in. (Optional) |
damage (optional) |
integer | The damage of the explosion. Defaults to 2 * destruction level (Optional) |
source (optional) |
userdata | The source of the explosion. Defaults to none (Optional) |
type (optional) |
Uuid | The explosionType. Defaults to nil uuid (Optional) |