> For the complete documentation index, see [llms.txt](https://vc-docs.gitbook.io/engine/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vc-docs.gitbook.io/engine/home/doxygen_synced/classes/class_vector3.md).

# Vector3

**Usage:** `api.Vector3.Add(a, b)`

Exposes unity [Vector3](/engine/home/doxygen_synced/classes/class_vector3.md) math operations to the JavaScript API layer.

## Public Functions

|                     | Name                                                                                                                                                                                                                                                                                                                                                           |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| UnityEngine.Vector3 | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_vector3.md#function-minus"><strong>Minus</strong></a>(UnityEngine.Vector3 l, UnityEngine.Vector3 r)<br>Subtracts vector <em>r</em> from vector <em>l</em> .</p>                                                                                              |
| UnityEngine.Vector3 | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_vector3.md#function-add"><strong>Add</strong></a>(UnityEngine.Vector3 l, UnityEngine.Vector3 r)<br>Adds two vectors component-wise.</p>                                                                                                                      |
| UnityEngine.Vector3 | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_vector3.md#function-multiply"><strong>Multiply</strong></a>(UnityEngine.Vector3 l, float num)<br>Scales a vector uniformly by a scalar value.</p>                                                                                                            |
| UnityEngine.Vector3 | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_vector3.md#function-multiply"><strong>Multiply</strong></a>(float num, UnityEngine.Vector3 r)<br>Scales a vector uniformly by a scalar value.</p>                                                                                                            |
| UnityEngine.Vector3 | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_vector3.md#function-multiply"><strong>Multiply</strong></a>(UnityEngine.Vector3 l, UnityEngine.Vector3 r)<br>Scales a vector component-wise by another vector. Each component of <em>l</em> is multiplied by the corresponding component of <em>r</em> .</p> |
| UnityEngine.Vector3 | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_vector3.md#function-multiply"><strong>Multiply</strong></a>(UnityEngine.Quaternion quaternion, UnityEngine.Vector3 vector)<br>Rotates a vector by a quaternion.</p>                                                                                          |
| UnityEngine.Vector3 | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_vector3.md#function-lerp"><strong>Lerp</strong></a>(UnityEngine.Vector3 start, UnityEngine.Vector3 target, float time)<br>Linearly interpolates between two vectors by a normalized factor.</p>                                                              |
| UnityEngine.Vector3 | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_vector3.md#function-movetowards"><strong>MoveTowards</strong></a>(UnityEngine.Vector3 start, UnityEngine.Vector3 target, float distance)<br>Moves a vector towards a target at a constant maximum step distance per call.</p>                                |

## Public Properties

|                     | Name                                                                                                                                                                                                             |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| UnityEngine.Vector3 | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_vector3.md#property-zero"><strong>zero</strong></a><br>A vector with all components set to zero (0, 0, 0).</p> |

## Public Functions Documentation

### function Minus

```csharp
static UnityEngine.Vector3 Minus(
    UnityEngine.Vector3 l,
    UnityEngine.Vector3 r
)
```

Subtracts vector *r* from vector *l* .

**Parameters**:

* **l** The left-hand vector.
* **r** The vector to subtract.

**Return**: The result of *l* - *r* .

### function Add

```csharp
static UnityEngine.Vector3 Add(
    UnityEngine.Vector3 l,
    UnityEngine.Vector3 r
)
```

Adds two vectors component-wise.

**Parameters**:

* **l** The left-hand vector.
* **r** The right-hand vector.

**Return**: The result of *l* + *r* .

### function Multiply

```csharp
static UnityEngine.Vector3 Multiply(
    UnityEngine.Vector3 l,
    float num
)
```

Scales a vector uniformly by a scalar value.

**Parameters**:

* **l** The vector to scale.
* **num** The scalar multiplier.

**Return**: The result of *l* \* *num* .

### function Multiply

```csharp
static UnityEngine.Vector3 Multiply(
    float num,
    UnityEngine.Vector3 r
)
```

Scales a vector uniformly by a scalar value.

**Parameters**:

* **num** The scalar multiplier.
* **r** The vector to scale.

**Return**: The result of *num* \* *r* .

### function Multiply

```csharp
static UnityEngine.Vector3 Multiply(
    UnityEngine.Vector3 l,
    UnityEngine.Vector3 r
)
```

Scales a vector component-wise by another vector. Each component of *l* is multiplied by the corresponding component of *r* .

**Parameters**:

* **l** The vector to scale.
* **r** The vector to scale by.

**Return**: The component-wise product of *l* and *r* .

### function Multiply

```csharp
static UnityEngine.Vector3 Multiply(
    UnityEngine.Quaternion quaternion,
    UnityEngine.Vector3 vector
)
```

Rotates a vector by a quaternion.

**Parameters**:

* **quaternion** The rotation to apply.
* **vector** The vector to rotate.

**Return**: The rotated vector.

### function Lerp

```csharp
static UnityEngine.Vector3 Lerp(
    UnityEngine.Vector3 start,
    UnityEngine.Vector3 target,
    float time
)
```

Linearly interpolates between two vectors by a normalized factor.

**Parameters**:

* **start** The starting vector when *time* is 0.
* **target** The target vector when *time* is 1.
* **time** Interpolation factor, clamped to the range \[0, 1].

**Return**: The interpolated vector.

### function MoveTowards

```csharp
static UnityEngine.Vector3 MoveTowards(
    UnityEngine.Vector3 start,
    UnityEngine.Vector3 target,
    float distance
)
```

Moves a vector towards a target at a constant maximum step distance per call.

**Parameters**:

* **start** The current position.
* **target** The position to move towards.
* **distance** The maximum distance to move in a single step.

**Return**: The new position, at most *distance* units closer to *target* .

## Public Property Documentation

### property zero

```csharp
static UnityEngine.Vector3 zero;
```

A vector with all components set to zero (0, 0, 0).

***

Updated on 2026-07-22 at 12:00:00 +0800
