# sm.vec3.new

Creates a new vector from an existing one.

**Kind:** Function

**Environments:** Game, Terrain

## Game

### Game overload 1

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

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

**Parameters:**

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

**Returns:**

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

### Game overload 2

``` { .lua .api-signature }
sm.vec3.new( x, y, z )
```

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

Creates a new vector.

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `x` | number | The X value. |
| `y` | number | The Y value. |
| `z` | number | The Z value. |

**Returns:**

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

## Terrain

### Terrain overload 1

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

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

**Parameters:**

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

**Returns:**

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

### Terrain overload 2

``` { .lua .api-signature }
sm.vec3.new( x, y, z )
```

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

Creates a new vector.

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `x` | number | The X value. |
| `y` | number | The Y value. |
| `z` | number | The Z value. |

**Returns:**

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