# half4

> Constructs a half4 vector from four half values.

## Definition

* **Type:** Constructor
* **Namespace:** [Unity.Mathematics](/engine/6000.5/script-reference/unity/mathematics.md)
* **Assembly:** UnityEngine.MathematicsModule

## half4(half, half, half, half)

Constructs a half4 vector from four half values.

```csharp
public half4(half x, half y, half z, half w)
```

### Parameters

**** (\[half]\(/engine/6000.5/script-reference/unity/mathematics/half)): The constructed vector's x component will be set to this value.**** (\[half]\(/engine/6000.5/script-reference/unity/mathematics/half)): The constructed vector's y component will be set to this value.**** (\[half]\(/engine/6000.5/script-reference/unity/mathematics/half)): The constructed vector's z component will be set to this value.**** (\[half]\(/engine/6000.5/script-reference/unity/mathematics/half)): The constructed vector's w component will be set to this value.

## half4(half, half, half2)

Constructs a half4 vector from two half values and a half2 vector.

```csharp
public half4(half x, half y, half2 zw)
```

### Parameters

**** (\[half]\(/engine/6000.5/script-reference/unity/mathematics/half)): The constructed vector's x component will be set to this value.**** (\[half]\(/engine/6000.5/script-reference/unity/mathematics/half)): The constructed vector's y component will be set to this value.**** (\[half2]\(/engine/6000.5/script-reference/unity/mathematics/half2)): The constructed vector's zw components will be set to this value.

## half4(half, half2, half)

Constructs a half4 vector from a half value, a half2 vector and a half value.

```csharp
public half4(half x, half2 yz, half w)
```

### Parameters

**** (\[half]\(/engine/6000.5/script-reference/unity/mathematics/half)): The constructed vector's x component will be set to this value.**** (\[half2]\(/engine/6000.5/script-reference/unity/mathematics/half2)): The constructed vector's yz components will be set to this value.**** (\[half]\(/engine/6000.5/script-reference/unity/mathematics/half)): The constructed vector's w component will be set to this value.

## half4(half, half3)

Constructs a half4 vector from a half value and a half3 vector.

```csharp
public half4(half x, half3 yzw)
```

### Parameters

**** (\[half]\(/engine/6000.5/script-reference/unity/mathematics/half)): The constructed vector's x component will be set to this value.**** (\[half3]\(/engine/6000.5/script-reference/unity/mathematics/half3)): The constructed vector's yzw components will be set to this value.

## half4(half2, half, half)

Constructs a half4 vector from a half2 vector and two half values.

```csharp
public half4(half2 xy, half z, half w)
```

### Parameters

**** (\[half2]\(/engine/6000.5/script-reference/unity/mathematics/half2)): The constructed vector's xy components will be set to this value.**** (\[half]\(/engine/6000.5/script-reference/unity/mathematics/half)): The constructed vector's z component will be set to this value.**** (\[half]\(/engine/6000.5/script-reference/unity/mathematics/half)): The constructed vector's w component will be set to this value.

## half4(half2, half2)

Constructs a half4 vector from two half2 vectors.

```csharp
public half4(half2 xy, half2 zw)
```

### Parameters

**** (\[half2]\(/engine/6000.5/script-reference/unity/mathematics/half2)): The constructed vector's xy components will be set to this value.**** (\[half2]\(/engine/6000.5/script-reference/unity/mathematics/half2)): The constructed vector's zw components will be set to this value.

## half4(half3, half)

Constructs a half4 vector from a half3 vector and a half value.

```csharp
public half4(half3 xyz, half w)
```

### Parameters

**** (\[half3]\(/engine/6000.5/script-reference/unity/mathematics/half3)): The constructed vector's xyz components will be set to this value.**** (\[half]\(/engine/6000.5/script-reference/unity/mathematics/half)): The constructed vector's w component will be set to this value.

## half4(half4)

Constructs a half4 vector from a half4 vector.

```csharp
public half4(half4 xyzw)
```

### Parameters

**** (\[half4]\(/engine/6000.5/script-reference/unity/mathematics/half4)): The constructed vector's xyzw components will be set to this value.

## half4(half)

Constructs a half4 vector from a single half value by assigning it to every component.

```csharp
public half4(half v)
```

### Parameters

**** (\[half]\(/engine/6000.5/script-reference/unity/mathematics/half)): half to convert to half4

## half4(float)

Constructs a half4 vector from a single float value by converting it to half and assigning it to every component.

```csharp
public half4(float v)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): float to convert to half4

## half4(float4)

Constructs a half4 vector from a float4 vector by componentwise conversion.

```csharp
public half4(float4 v)
```

### Parameters

**** (\[float4]\(/engine/6000.5/script-reference/unity/mathematics/float4)): float4 to convert to half4

## half4(double)

Constructs a half4 vector from a single double value by converting it to half and assigning it to every component.

```csharp
public half4(double v)
```

### Parameters

**** (\[double]\(https\://learn.microsoft.com/dotnet/api/system.double)): double to convert to half4

## half4(double4)

Constructs a half4 vector from a double4 vector by componentwise conversion.

```csharp
public half4(double4 v)
```

### Parameters

**** (\[double4]\(/engine/6000.5/script-reference/unity/mathematics/double4)): double4 to convert to half4
