# sm.vec3.closestAxis

Finds the closest axis-aligned vector from the given vector

**Kind:** Function

**Environments:** Game, Terrain

## Game

``` { .lua .api-signature }
sm.vec3.closestAxis( vector )
```

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

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `vector` | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The vector. |

**Returns:**

| Type | Description |
| --- | --- |
| [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The axis-aligned vector. |

## Terrain

``` { .lua .api-signature }
sm.vec3.closestAxis( vector )
```

[Open the full Terrain reference](../Terrain-Script-Environment/Static-Functions/sm.vec3.md#closestaxis)

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `vector` | [Vec3](../Terrain-Script-Environment/Userdata/Vec3.md) | The vector. |

**Returns:**

| Type | Description |
| --- | --- |
| [Vec3](../Terrain-Script-Environment/Userdata/Vec3.md) | The axis-aligned vector. |
