Friction Joint 2D
Relative Joint 2D

Hinge Joint 2D

Switch to Scripting

The Hinge Joint 2D component allows a game object controlled by rigidbody physics to be attached to a point in space around which it can rotate. The rotation can be left to happen passively (in response to a collision, say) or be actively powered by a motor torque provided by the joint itself. You can set limits to prevent the hinge from making a full rotation, or make more than a single rotation.

Properties

Property: Function:
Enable Collision Can the two connected objects collide with each other? Check the box for yes.
Connected Rigid Body Specify here the other object this joint connects to. Leave this as None and the other end of the joint will be fixed at a point in space defined by the Connected Anchor setting. Select the circle to the right of the field to view a list of objects to connect to.
Auto Configure Connected Anchor Check this box to automatically set the anchor location for the other object this joint connects to. (Check this instead of completing the Connected Anchor fields.)
Anchor The place (in terms of X, Y co-ordinates on the RigidBody) where the end point of the joint connects to this object.
Connected Anchor The place (in terms of X, Y co-ordinates on the RigidBody) where the end point of the joint connects to the other object.
Motor
Use Motor Should the hinge motor be enabled? Check the box for yes.
Motor Speed Target motor speed (degrees/sec).
Maximum Motor Force The maximum torque (or rotation) the motor can apply while attempting to reach the target speed.
Use Limits Should the rotation angle be limited?
Angle Limits
Lower Angle The lower end of the rotation arc allowed by the limit.
Upper Angle The upper end of the rotation arc allowed by the limit.
Break Force Specify the linear (or straight line) force level needed to break and so delete the joint. Infinity means it is unbreakable.
Break Torque Specify the the angular (or rotation) level needed to break and so delete the joint. Infinity means it is unbreakable.

Details

(See also Joints 2D: Details and Hints for useful background information on all 2D joints.)

The hinge joint’s name suggest a door hinge. It can be used as a door hinge, but also anything that rotates around a particular point; machine parts, powered wheels, and pendulums, for example.

You can use this joint to make two points overlap. Those two points can be two Rigidbody2D components or a Rigidbody2D component and a fixed position in the world. (Connect to a fixed position in the world by setting Connected Rigidbody to None). The joint applies a linear force to both connected rigid body objects.

The joint has a simulated rotational motor which you can turn on or off. Set the Maximum Motor Speed and Maximum Motor Force to control the angular speed (Torque), and make the two rigid body objects rotate in an arc relative to each other. Set the limits of the arc using Lower Angle and Upper Angle.

Hinge Joint 2D has three simultaneous constraints. All are optional:

  • Maintain a relative linear distance between two anchor points on two rigid body objects.
  • Maintain an angular speed between two anchor points on two rigid body objects (limited with a maximum torque in Maximum Motor Force .
  • Maintain an angle within a specified arc.

For Example:

You can use this joint to construct physical objects that need to react as if they are connected with a rotational pivot. Such as:

  • A see-saw pivot where the horizontal section is connected to the base. (Use the joint’s Angle Limits to simulate the highest and lowest point of the see-saw’s movement.)
  • A pair of scissors connected together with a hinge pivot. (You can use the joint’s Angle Limits to simulate the closing and maximum opening of the scisssors.)
  • A simple wheel connected to the body of a car with the pivot connecting the wheel at its center to the car. (In this example you can use the joint’s motor to rotate the wheel.)
Friction Joint 2D
Relative Joint 2D