Rotate parent so child is facing a specific rotation

Hi,

I have a parent cube with several small child cylinders, pointing out from the cube in each direction. I would like to rotate the cube so one of the child cylinders is facing in a specific rotation (basically I want the player to be able to select a child cylinder and that cylinder will determine the rotation of the parent cube).

I’ve tried several things, but it seems to be somewhat more complicated than what I thought initially. So I would very much appreciate if anyone has any thoughts that might help me.

Thanks a bunch,
Simon

I found a possible solution:

connector.transform.parent.rotation = connector.transform.parent.rotation * Quaternion.FromToRotation(connector.transform.up, -_connector.transform.up);

(Here the connectors are the child cylinders (connector is the child of the parent cube and _connector is the child of another cube I want to rotate the parent cube towards so both the connectors are looking at eachother!))