I have a problem with the hinge joint component.
The variable ‘angle’ (hingejoint.angle) returns a strange value.
I have two square, the first one has the hinge joint who target the second one.
When I rotate the first one, the variable ‘angle’ change but the squares are always aligned.
Not sure what, if any hierarchy here is, but make sure you’re not placing them in a hierarchy with one as a child of the other. Also, when you say, “When I rotate the first one”, make sure that isn’t you just modifying the transform because that isn’t a physics-friendly operation; it’s just instantly changing the poses and bypassing physics. Physics only works when you go through the physics APIs to change poses so use Rigidbody.MoveRotation etc.
I changed a little the project.
I have a game object with 3 children: 1 corpse and two squares.
If I use the motor of the first hinge joint, my angle between the squares changed when he should be 0 degree.
I don’t use a move transform or others, just the motor component.
Maybe you can show this “angle between the squares” better. The images above don’t show anything really. Maybe show the inspector or more details, maybe a video.