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