# sm.unit.getUnitsInRange

Returns a table with units within a given range.

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
sm.unit.getUnitsInRange( world, position, range, heightModifier? )
```

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

**Availability:** Server only

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `world` | [World](../Game-Script-Environment/Userdata/World.md) | The world to check in. |
| `position` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The position to check from. |
| `range` | number | The range to check. |
| `heightModifier` *(optional)* | number | A value to modify the height of the range check. Defaults to 1. Higher values makes enemy elevation difference deemed as greater distance. |
