sm.physics.sphereContactCount

Returns the number of collision objects that are found inside the given sphere

Kind: Function

Environments: Game

Game

sm.physics.sphereContactCount(
    worldPosition,
    radius,
    includeTerrain,
    countWater,
    mask
)

Open the full Game reference

Parameters:

Name Type Description
worldPosition Vec3 The world position of the sphere.
radius number The radius of the sphere.
includeTerrain (optional) boolean True if terrain should be included in the test (Defaults to false)
countWater (optional) boolean True if water should be included (Defaults to false)
mask (optional) integer The collision mask. Defaults to sm.physics.filter.default. Using this will override "includeTerrain" and "countWater". (Optional)

Returns:

Type Description
integer The number of objects.