# Vector4.WithX

```csharp
Vector4 WithX(float x)
```

Returns this vector with given X component.

### Parameters

- `x` (`float`): The override for X component.

### Returns

`Vector4`: The new vector.

Declared in [Vector4](/api/Vector4).
Assembly: `Sandbox.System`.
