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