# Vector4.Clamp

## Overload 1

```csharp
Vector4 Clamp(Vector4 otherMin, Vector4 otherMax)
```

Returns a vector each axis of which is clamped to between the 2 given vectors.

### Parameters

- `otherMin` (`Vector4`): The mins vector. Values on each axis should be smaller than those of the maxs vector. See [Vector4.Sort](/api/Vector4/Sort).
- `otherMax` (`Vector4`): The maxs vector. Values on each axis should be bigger than those of the mins vector. See [Vector4.Sort](/api/Vector4/Sort).

### Returns

`Vector4`

## Overload 2

```csharp
Vector4 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

`Vector4`

## Overload 3

```csharp
static Vector4 Clamp(in Vector4 value, in Vector4 min, in Vector4 max)
```

Restricts a vector between a minimum and a maximum value.

### Parameters

- `in value` (`Vector4`): The vector to restrict.
- `in min` (`Vector4`): The mins vector. Values on each axis should be smaller than those of the maxs vector. See [Vector4.Sort](/api/Vector4/Sort).
- `in max` (`Vector4`): The maxs vector. Values on each axis should be bigger than those of the mins vector. See [Vector4.Sort](/api/Vector4/Sort).

### Returns

`Vector4`

Declared in [Vector4](/api/Vector4).
Assembly: `Sandbox.System`.
