# Vector4

> Creates a new vector with given x, y, z, w components.

## Definition

* **Type:** Constructor
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

## Vector4(float, float, float, float)

Creates a new vector with given x, y, z, w components.

```csharp
public Vector4(float x, float y, float z, float w)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Value for the x component.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Value for the y component.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Value for the z component.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Value for the w component.

## Vector4(float, float, float)

Creates a new vector with given x, y, z components and sets `w` to zero.

```csharp
public Vector4(float x, float y, float z)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Value for the x component.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Value for the y component.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Value for the z component.

## Vector4(float, float)

Creates a new vector with given x, y components and sets `z` and `w` to zero.

```csharp
public Vector4(float x, float y)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Value for the x component.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): Value for the y component.
