World.voxelDensityAddition

Modify destructable terrain

Kind: Function

Environments: Game

Game

world:voxelDensityAddition(
    position,
    surfaceNormal,
    maxDistance,
    targetDensity,
    material,
    filter,
    player
)

Open the full Game reference

Availability: Server only

Parameters:

Name Type Description
world World The world.
position Vec3 The voxel world position.
surfaceNormal Vec3 The surface normal.
maxDistance number The maximum distance from position that can be modified.
targetDensity integer The target density to add.
material integer The material to add [0-7].
filter (optional) integer The materials the shape can modify. (See sm.world.voxelFilter). (Defaults to sm.world.voxelFilter.all)
player (optional) Player The player who constructed. (Optional)