Rotate the rows and columns on a Rubik's Cube

Hello everybody, I made a Rubik's Cube in Blender and imported it to Unity. I trying to figure out how to write a code to make the columns and rows rotate on the Rubik's Cube. I am new to Untiy so I don't really know want I'm doing. Can anyone help me out please.


In theory, you could get the face you want to turn, acquire all of the cubes on that face, use trigonometry to calculate their current rotation to that faces axis, and then use trigonometry to rotate them around the face-axis, and finally sync the rotation of the cubes to the trigonomic rotation.

You can use Vector3.Angle to calculate the relative angle. Then, you can set the position of the objects to: `new Vector3(Mathf.Cos(angleyouwant * Mathf.Deg2Rad) + pivotpoint.x,Mathf.Sin(angleyouwant * Mathf.Deg2Rad) + pivotpoint.y,0);`

NOTE: I wrote the previous trigonomic math from memory. I never took trigonometry, so it probably isn't accurate. Still, it gives the basic idea.