Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

how to set up multiple hinge joints?

Discussion in 'Editor & General Support' started by sgower, Apr 20, 2018.

  1. sgower

    sgower

    Joined:
    Mar 9, 2015
    Posts:
    316
    Hello, I'm trying to get multiple hinge joints working as shown below. In this example, the top cube is kinematic, and the two lower cubes and the hinges should swing freely.

    Should the HingeJoint be added to the top part of the hinge, and then have the connectedbody set to the lower hinge piece? Or should the HingeJoint be attached to the lower hinge piece, and the connected body be the top hinge piece?

    If I add a HingeJoint to the top hinge object, and set the connected body to the lower piece, this works fine. But the problem happens when I introduce the 2nd hinge. For the top hinge, I'm setting useGravity=true for the bottom piece of the hinge. But then I'm not sure what setting should be used for the top piece of the 2nd hinge. If I set useGravity=true, then the bottom hinge falls for the ground. If I set isKinematic=true then the bottom hinge goes crazy. I believe this is because Unity doesn't like having a kinematic Rigidbody that is a child of another rigidbody that uses gravity.

    would appreciate your help. thanks.