---
title: quaternion4
product: Unity Editor
version: '7000.0'
latest_version: '7000.0'
status: This page documents version 7000.0. The latest version is 7000.0.
canonical: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/animations/quaternion4/ctor
latest_url: https://docs.unity.com/en-us/engine/7000.0/script-reference/unity/animations/quaternion4/ctor.md
last_updated: 2026-11-30
generated_at: 2026-11-30T21:27:40.061Z
locale: en-us
---

# quaternion4

> Creates a quaternion4 from four vectors that hold the components of the four quaternions.

## Definition

* **Type:** Constructor
* **Namespace:** [Unity.Animations](/engine/7000.0/script-reference/unity/animations.md)
* **Assembly:** [UnityEngine.AnimationCoreModule](/engine/7000.0/script-reference/modules/unityengine-animationcoremodule.md)

## quaternion4(float4, float4, float4, float4)

Creates a quaternion4 from four vectors that hold the components of the four quaternions.

```csharp
public quaternion4(float4 x, float4 y, float4 z, float4 w)
```

### Parameters

**** (\[float4]\(/engine/7000.0/script-reference/unity/mathematics/float4)): The x components of the four quaternions, one in each lane.**** (\[float4]\(/engine/7000.0/script-reference/unity/mathematics/float4)): The y components of the four quaternions, one in each lane.**** (\[float4]\(/engine/7000.0/script-reference/unity/mathematics/float4)): The z components of the four quaternions, one in each lane.**** (\[float4]\(/engine/7000.0/script-reference/unity/mathematics/float4)): The w components of the four quaternions, one in each lane.

### Remarks

Lane 0 of each parameter holds a component of the first quaternion, lane 1 holds a component of the second quaternion, and so on. The constructor doesn't normalize the values. To build a quaternion4 from four separate quaternions, use the constructor that takes four `quaternion` values.

## quaternion4(quaternion, quaternion, quaternion, quaternion)

Creates a quaternion4 from four quaternions.

```csharp
public quaternion4(quaternion q0, quaternion q1, quaternion q2, quaternion q3)
```

### Parameters

**** (\[quaternion]\(/engine/7000.0/script-reference/unity/mathematics/quaternion)): The quaternion to store in lane 0 of the new quaternion4.**** (\[quaternion]\(/engine/7000.0/script-reference/unity/mathematics/quaternion)): The quaternion to store in lane 1 of the new quaternion4.**** (\[quaternion]\(/engine/7000.0/script-reference/unity/mathematics/quaternion)): The quaternion to store in lane 2 of the new quaternion4.**** (\[quaternion]\(/engine/7000.0/script-reference/unity/mathematics/quaternion)): The quaternion to store in lane 3 of the new quaternion4.

### Remarks

The constructor stores each quaternion in its own lane: the components of `q0` go to lane 0 of x, y, z, and w, the components of `q1` go to lane 1, and so on. The constructor doesn't normalize the quaternions.

## quaternion4(float4x4)

Creates a quaternion4 from the four columns of a matrix.

```csharp
public quaternion4(float4x4 m)
```

### Parameters

**** (\[float4x4]\(/engine/7000.0/script-reference/unity/mathematics/float4x4)): The matrix whose columns hold the x, y, z, and w components of the four quaternions.

### Remarks

The columns of the matrix become the fields [quaternion4.x](/engine/7000.0/script-reference/unity/animations/quaternion4/x.md), [quaternion4.y](/engine/7000.0/script-reference/unity/animations/quaternion4/y.md), [quaternion4.z](/engine/7000.0/script-reference/unity/animations/quaternion4/z.md), and [quaternion4.w](/engine/7000.0/script-reference/unity/animations/quaternion4/w.md). This constructor doesn't convert a rotation matrix into quaternions.
