Actually I found it quite hard to find an appropriate titel, so please excuse that.
Assume I have 4 points/gameoobject (cubes) and one center point (sphere). They are position around the center. There are some conditions:
- The don’t have to have the same distance to the origin e.g. they don’t have to be symmetrically arranged.
- The center points of the cubes almost build a plane. This means that if I would create a plane in Unity I would find a rotation for that plane such that each center point is (almost, or with a small distance) part of that plane. I hope that makes sense.
- The rotation of each cube does not matter.
In the above image you see an example.
How do I find a rotation for each cube, that in the end all of them are only placed on two axis (e.g. x-y or x-z)
It doesn matter if one cube or two have to move slightly to lie on the same plane.
Ok lets take a stab at this question. Picture time:

- Start by getting the directional vector from your center point sphere to cube1. (cube1.position - sphere.position)
- do the same thing for cube2 (cube2.position - sphere.position)
- Do a cross product to get the normal of those. Vector3.Cross
- If you want to average the normals between all the points you could repeat this for each two cubes. (1-2, 2-3, 3-4, 4-1) then average the normals.
- If you need all your cubes to lie on that plane you can do some geometry and get the direction from cube1 to sphere which is the hyponose and the inverse normal. Make sure you normalize the vectors but store the length of the hypotenuse. Get the angle between those 2 vectors (theta). Then calculate sin(theta) * hypotenuse length will equal the opposite length. Then from you cube1 move the cube along the inverse normal at that length.
I know that was complicated so let me know if you have any questions. And I hope that helped.