# sm.physics.sphereContactCount

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

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
sm.physics.sphereContactCount(
    worldPosition,
    radius,
    includeTerrain?,
    countWater?,
    mask?
)
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/sm.physics.md#spherecontactcount)

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `worldPosition` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | 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](../Game-Script-Environment/Static-Functions/sm.physics.md#filter). Using this will override "includeTerrain" and "countWater". (Optional) |

**Returns:**

| Type | Description |
| --- | --- |
| integer | The number of objects. |
