Apply this component to two objects controlled by rigidbody physics to keep them in a position relative to each other, so the objects are always offset at a given position and angle. It is a spring type joint for which you don’t need to set maximum forces. You can set the spring to be rigid or soft.
See Fixed vs. Relative Joint below for more information about the differences between FixedJoint2D and RelativeJoint2D.
Property: | Function: |
---|---|
Enable Collision | Check this box to enable the ability for the two connected objects to collide with each other. |
Connected Rigid Body | Specify the other object this joint connects to. Leave this as None to fix the other end of the joint 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. |
Damping Ratio | The degree to which you want to suppress spring oscillation: In the range 0 to 1, the higher the value, the less movement. |
Frequency | The frequency at which the spring oscillates while the objects are approaching the separation distance you want (measured in cycles per second): In the range 1 to 1,000,000, the higher the value, the stiffer the spring. Note that if the frequency is set to 0, the spring will be completely stiff. |
Break Force | Specify the force level needed to break and so delete the joint. Infinity means it is unbreakable. |
Break Torque | Specify the torque level needed to break and so delete the joint. Infinity means it is unbreakable. |
(See also Joints 2D: Details and Hints for useful background information on all 2D joints.)
The aim of this joint is to maintain a relative linear and angular offset between two points. 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 linear and angular offsets are based upon the relative positions and orientations of the two connected points, so you change the offsets by moving the connected game objects in your Scene View.
The joint applies both linear and torque forces to connected rigid body objects. It uses a simulated spring that is pre-configured to be as stiff as the simulation can provide. You can change the spring’s value to make it weaker using the Frequency setting.
When the spring applies its force between the objects, it tends to overshoot the desired distance between them and then rebound repeatedly, resulting in a continuous oscillation. The damping ratio determines how quickly the oscillation reduces and brings the objects to rest. The frequency is the rate at which it oscillates either side of the target distance; the higher the frequency, the stiffer the spring.
Fixed Joint 2D has two simultaneous constraints:
For Example:
You can use this joint to construct physical objects that need to react as if they are rigidly connected: They can’t move away from each other, they can’t move closer together, and they can’t rotate with respect to each other, such as a bridge made of sections which hold rigidly together.
You can also use this joint to create a less rigid connection that flexes; a bridge made of sections which are slightly flexible.
FixedJoint2D is spring type joint. RelativeJoint2D is a motor type joint with a maximum force and/or torque.