# Vector3.Clamp

## Overload 1

```csharp
Vector3 Clamp(Vector3 otherMin, Vector3 otherMax)
```

Returns a vector each axis of which is clamped to between the 2 given vectors. Basically clamps a point to an Axis Aligned Bounding Box (AABB).

### Parameters

- `otherMin` (`Vector3`): The mins vector. Values on each axis should be smaller than those of the maxs vector. See [Vector3.Sort](/api/Vector3/Sort).
- `otherMax` (`Vector3`): The maxs vector. Values on each axis should be bigger than those of the mins vector. See [Vector3.Sort](/api/Vector3/Sort).

### Returns

`Vector3`

## Overload 2

```csharp
Vector3 Clamp(float min, float max)
```

Returns a vector each axis of which is clamped to given min and max values.

### Parameters

- `min` (`float`): Minimum value for each axis.
- `max` (`float`): Maximum value for each axis.

### Returns

`Vector3`

## Overload 3

```csharp
static Vector3 Clamp(in Vector3 value, in Vector3 min, in Vector3 max)
```

Restricts a vector between a minimum and a maximum value.

### Parameters

- `in value` (`Vector3`): The vector to restrict.
- `in min` (`Vector3`): The mins vector. Values on each axis should be smaller than those of the maxs vector. See [Vector3.Sort](/api/Vector3/Sort).
- `in max` (`Vector3`): The maxs vector. Values on each axis should be bigger than those of the mins vector. See [Vector3.Sort](/api/Vector3/Sort).

### Returns

`Vector3`

Declared in [Vector3](/api/Vector3).
Assembly: `Sandbox.System`.
