# World.getDominantMaterialInSphere

Finds the dominant voxel material inside a sphere volume.

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
world:getDominantMaterialInSphere( position, radius )
```

[Open the full Game reference](../Game-Script-Environment/Userdata/World.md#getdominantmaterialinsphere)

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `world` | [World](../Game-Script-Environment/Userdata/World.md) | The world to look in. |
| `position` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The center position of the sphere. |
| `radius` | number | The radius of the sphere. |

**Returns:**

| Type | Description |
| --- | --- |
| integer | The dominant material index value. (returns nil if no voxel was found) |
| integer | The highest single-voxel density of the dominant material. |
| [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The weighted average world position of the dominant material (biased toward dense, nearby voxels). |
