Matrix4x4 matrix = new Matrix4x4(); matrix[0, 0] = 1f; matrix[0, 1] = 2f; matrix[0, 2] = 3f; matrix[0, 3] = 4f; Vector4 row = matrix.GetRow(0); Debug.Log(row); // prints "(1.0, 2.0, 3.0, 4.0)"
Matrix4x4 matrix = new Matrix4x4(); matrix[3, 0] = 5f; matrix[3, 1] = 6f; matrix[3, 2] = 7f; matrix[3, 3] = 8f; Vector4 row = matrix.GetRow(3); Debug.Log(row); // prints "(5.0, 6.0, 7.0, 8.0)"In this example, we set the values in the fourth row of the matrix and retrieve it using the GetRow method. Package library: UnityEngine.