sm.debris

Debris are visual objects that have no impact on any other object.

Functions:

  • createBlackHole
  • createDebris

  • sm.debris.createBlackHole(position, radius?, force?, position2?, wanderForce?, dissolveRadius?, timeToLive?, channel?)

    Client only

    Add a black hole that attracts nearby debris towards its position.

    Parameters:

    TypeNameDescription
    Vec3positionThe position of the black hole.
    numberradius?The radius of effect. (Defaults to 10)
    numberforce?The attraction force. (Defaults to 100)
    Vec3position2?An optional secondary position, making the black hole a capsule shape instead of a sphere.
    numberwanderForce?A force applied along direction from position to position2. (Defaults to 0)
    numberdissolveRadius?The radius within which debris will start to dissolve. (Defaults to 0)
    numbertimeToLive?The time the black hole will be simulated before disappearing. (Defaults to one tick)
    numberchannel?The channel this black hole affects. Debris only reacts to black holes matching its channel. 0 means no debris is affected. (Defaults to 1)

    sm.debris.createDebris(uuid, position, rotation, velocity?, angularVelocity?, color?, timeToLive?, gravity?, friction?, linearDamping?, angularDamping?, time?)

    Client only

    Create visual debris of a shape from its uuid, that collides with world objects but does not have an impact on them.

    Parameters:

    TypeNameDescription
    UuiduuidThe uuid of the shape.
    Vec3positionThe position.
    QuatrotationThe rotation.
    Vec3velocity?The linear velocity. (Defaults to zero)
    Vec3angularVelocity?The angular velocity in radians per second around the axes (x,y,z). (Defaults to zero)
    Colorcolor?The color. (Defaults to the shape's default color)
    numbertimeToLive?Time to live. (Defaults to 10)
    numbergravity?Gravity vector. (Defaults to { 0,0,-10 })
    numberfriction?Amount of friction. (Defaults to 1)
    numberlinearDamping?Amount of linear damping. (Defaults to 0.3)
    numberangularDamping?Amount of angular damping. (Defaults to 0.3)
    numbertime?The time the debris will be simulated before disappearing. (Defaults to 10 seconds)