Cube changes size when adding HingeJoint

I’m scripting a house for fun and to learn Unity better. My current obstacle seems to be the scale of the door, to which I’m adding a HingeJoint.

The door is a gameobject in a hierarchy of other objects, like so (slightly simplified):

House:

  • floor1
    • wallpiece
    • door
    • wallpiece
    • wallpiece
  • floor2
    • wallpiece
    • window
    • wallpiece
    • wallpiece
  • floor3-- etc

Everything is set using localscales and localpositions, and as a result displays perfectly positioned and scaled where I want it.

The problem:
Adding a HingeJoint to the door makes the cube (the door) noticeably bigger. It no longer fits in its doorhole.

Looking at the localscale values of the door, they are the exact same before and after adding the hingejoint. The object itself however is visibly bigger.

Thanks for any insight into what is causing this, and thanks for a great tool like Unity 3d!

The point of an object hierarchy is that all childs inherit the parent position / rotation and scale. If you scale up the parent, all childs will be scaled as well.

Every GameObject represents another localspace in which other gameobjects can “live”.

This was human error, the door had the wrong size all along. Adding a hingeJoint just revealed the problem.