# float2

> Returns a float2 vector constructed from two float values.

## Definition

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

## float2(float, float)

Returns a float2 vector constructed from two float values.

```csharp
public static float2 float2(float x, float y)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The constructed vector's x component will be set to this value.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The constructed vector's y component will be set to this value.

### Returns

| Type                                                                  | Description                        |
| --------------------------------------------------------------------- | ---------------------------------- |
| [float2](/engine/6000.5/script-reference/unity/mathematics/float2.md) | float2 constructed from arguments. |

## float2(float2)

Returns a float2 vector constructed from a float2 vector.

```csharp
public static float2 float2(float2 xy)
```

### Parameters

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

### Returns

| Type                                                                  | Description                        |
| --------------------------------------------------------------------- | ---------------------------------- |
| [float2](/engine/6000.5/script-reference/unity/mathematics/float2.md) | float2 constructed from arguments. |

## float2(float)

Returns a float2 vector constructed from a single float value by assigning it to every component.

```csharp
public static float2 float2(float v)
```

### Parameters

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

### Returns

| Type                                                                  | Description      |
| --------------------------------------------------------------------- | ---------------- |
| [float2](/engine/6000.5/script-reference/unity/mathematics/float2.md) | Converted value. |

## float2(bool)

Returns a float2 vector constructed from a single bool value by converting it to float and assigning it to every component.

```csharp
public static float2 float2(bool v)
```

### Parameters

**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): bool to convert to float2

### Returns

| Type                                                                  | Description      |
| --------------------------------------------------------------------- | ---------------- |
| [float2](/engine/6000.5/script-reference/unity/mathematics/float2.md) | Converted value. |

## float2(bool2)

Return a float2 vector constructed from a bool2 vector by componentwise conversion.

```csharp
public static float2 float2(bool2 v)
```

### Parameters

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

### Returns

| Type                                                                  | Description      |
| --------------------------------------------------------------------- | ---------------- |
| [float2](/engine/6000.5/script-reference/unity/mathematics/float2.md) | Converted value. |

## float2(int)

Returns a float2 vector constructed from a single int value by converting it to float and assigning it to every component.

```csharp
public static float2 float2(int v)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): int to convert to float2

### Returns

| Type                                                                  | Description      |
| --------------------------------------------------------------------- | ---------------- |
| [float2](/engine/6000.5/script-reference/unity/mathematics/float2.md) | Converted value. |

## float2(int2)

Return a float2 vector constructed from a int2 vector by componentwise conversion.

```csharp
public static float2 float2(int2 v)
```

### Parameters

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

### Returns

| Type                                                                  | Description      |
| --------------------------------------------------------------------- | ---------------- |
| [float2](/engine/6000.5/script-reference/unity/mathematics/float2.md) | Converted value. |

## float2(uint)

Returns a float2 vector constructed from a single uint value by converting it to float and assigning it to every component.

```csharp
public static float2 float2(uint v)
```

### Parameters

**** (\[uint]\(https\://learn.microsoft.com/dotnet/api/system.uint32)): uint to convert to float2

### Returns

| Type                                                                  | Description      |
| --------------------------------------------------------------------- | ---------------- |
| [float2](/engine/6000.5/script-reference/unity/mathematics/float2.md) | Converted value. |

## float2(uint2)

Return a float2 vector constructed from a uint2 vector by componentwise conversion.

```csharp
public static float2 float2(uint2 v)
```

### Parameters

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

### Returns

| Type                                                                  | Description      |
| --------------------------------------------------------------------- | ---------------- |
| [float2](/engine/6000.5/script-reference/unity/mathematics/float2.md) | Converted value. |

## float2(half)

Returns a float2 vector constructed from a single half value by converting it to float and assigning it to every component.

```csharp
public static float2 float2(half v)
```

### Parameters

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

### Returns

| Type                                                                  | Description      |
| --------------------------------------------------------------------- | ---------------- |
| [float2](/engine/6000.5/script-reference/unity/mathematics/float2.md) | Converted value. |

## float2(half2)

Return a float2 vector constructed from a half2 vector by componentwise conversion.

```csharp
public static float2 float2(half2 v)
```

### Parameters

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

### Returns

| Type                                                                  | Description      |
| --------------------------------------------------------------------- | ---------------- |
| [float2](/engine/6000.5/script-reference/unity/mathematics/float2.md) | Converted value. |

## float2(double)

Returns a float2 vector constructed from a single double value by converting it to float and assigning it to every component.

```csharp
public static float2 float2(double v)
```

### Parameters

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

### Returns

| Type                                                                  | Description      |
| --------------------------------------------------------------------- | ---------------- |
| [float2](/engine/6000.5/script-reference/unity/mathematics/float2.md) | Converted value. |

## float2(double2)

Return a float2 vector constructed from a double2 vector by componentwise conversion.

```csharp
public static float2 float2(double2 v)
```

### Parameters

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

### Returns

| Type                                                                  | Description      |
| --------------------------------------------------------------------- | ---------------- |
| [float2](/engine/6000.5/script-reference/unity/mathematics/float2.md) | Converted value. |
