Trouble with rotation of parents and children

For my platformer game, one of my obstacles is a large windmill device with four arms that rotates vertically in space. At the end of each arm is four platforms. I want the platforms to always stay parallel to the ground while moving with the windmill itself. The basic code I used for the platforms (transform.eulerAngles = Vector3.zero;) works… but only if the windmill is left in its original orientation.

The windmill has all four platforms as children, and itself is the child of an empty object I can use to position the whole setup where I want it. The problem is that rotating the empty 90 degrees along the y axis causes the platforms to clip through the windmill arms and, curiously, have their hitboxes become long and thin. I have tried a variety of solutions (included in the screenshot below) but all of them cause some kind of bizarre behavior in the platforms, such as having them become skewed and crooked.

I’m at my wits end. I’d prefer to have it done through a rigid body in anticipation of a future character/physics, but at this point I’ll take any insight on how to get the effect I want.

IMGUR Gallery with screenshots and further explanations: Windmill Unity Help - Album on Imgur

Not tested:

To have them spin with the main parent empty, but not with blades, could child them directly to that main empty. Of course, now they won’t move with the blades.

Then add empty “mountPoints” to the end of each windmill arm and use them to position the platforms:

public Transform myArmPos; // drag in correct arm empty

Update() {
  transform.position = myArmPos.position;
}

I want to say the oddly shaped colliders is caused by the known “childed scaled Unity cube acts weird” issue. Importing your own Cube model will often solve it (if it still happens when everything else is working.)

If you want to keep the childing as is, I think setting platform rotations to the same as the main empty parent might work: transform.rotation=parent.parent.rotation;

After experimenting further I found my own answer. At first I tried giving both the windmill and the platforms hingeJoints in their centers and it worked for a time, but I found a potentially better option.

First, I created an empty, kinematic rigidbody and used it as the connected body of the Windmill’s HingeJoint, creating an axis.
Second, I connected the platforms to the Windmill in the same way.
Thirdly, I checked “Freeze Rotation” in all three Axes for the platforms, preventing physics from changing them.
Finally, I created an empty Handle object and made it the parent of all the other objects.

Now I have the wheel, and the platforms will stay aligned (with physics!) to the Handle object no matter which way I tilt it. I can even enable the Motor function of the Windmill’s HingeJoint and everything functions well. I will continue to test, but it’s looking very solid.