As the name implies, jointsA physics component allowing a dynamic connection between Rigidbody components, usually allowing some degree of movement such as a hinge. More info
See in Glossary attach GameObjectsThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
See in Glossary together. You can only attach 2D joints to GameObjects which have a RigidbodyA component that allows a GameObject to be affected by simulated gravity and other forces. More info
See in Glossary 2D component attached, or to a fixed position in world space.
2D joints all have names ending ‘2D’. A joint named without a ‘2D’ ending is a 3D joint. 2D joints work with game objects in 2D and 3D joints work with game objects in 3D.
(See Details and Hints, below, for useful background information on all 2D joints.)
There are different types of 2D joints. See each joint reference page for detailed information about their properties:
Distance Joint 2D - attaches two game objects controlled by rigidbody physics together and keeps them a certain distance apart.
Fixed Joint 2DA 2D joint type which is completely constrained, allowing two objects to be held together. Implemented as a spring so some small motion may still occur. More info
See in Glossary - keeps two objects in a position relative to each other, so the objects are always offset at a given position and angle. For example, 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. You can also use this joint to create a less rigid connection that flexes.
Friction Joint 2D - reduces both the linear and angular velocities between two game objects controlled by rigidbody physics to zero (ie: it slows them down and stops them). For example; a platform that rotates but resists that movement.
Hinge Joint 2D- allows a game object controlled by rigidbody physics to be attached to a point in space around which it can rotate. For example; the pivot on a pair of scissors.
Relative Joint 2DA 2D joint that allows two game objects controlled by Rigidbody physics to maintain in a position based on each other’s location. Use this joint to keep two objects offset from each other, at a position and angle you decide More info
See in Glossary - allows two game objects controlled by rigidbody physics to maintain a position based on each other’s location. Use this joint to keep two objects offset from each other. For example; a space-shooter game where the player has extra gun batteries that follow them.
Slider Joint 2D - allows a game object controlled by rigidbody physics to slide along a line in space, like sliding doors, for example.
Spring Joint 2D - allows two game objects controlled by rigidbody physics to be attached together as if by a spring.
Target Joint 2D - connects to a specified target, rather than another rigid body object, as other joints do. It is a spring type joint, which you could use for picking up and moving an object acting under gravity, for example.
Wheel Joint 2D - simulates wheels and suspension.
All joints provide one or more constraints that apply to Rigidbody 2D behaviour. A constraint is a ‘rule’ which the joint will try to ensure isn’t permanently broken. There are different types of constraints available but usually a joint will only provide a few of them, sometimes only one. Some constraints limit behaviour such as ensuring a rigid body stays on a line, or in a certain position. Some are ‘driving’ constraints such as a motor that rotates or moves a rigid body object, trying to maintain a certain speed.
The physics system expects that constraints do become temporarily broken; the objects may move further apart than their distance constraint tells them, or objects may move faster than their motor-speed constraint. When a constraint isn’t broken, the joint doesn’t apply any forces and does little work. It is when a constraint is broken that the joint applies forces to fix the constraint: So for the ‘driving’ constraints mentioned above, it maintains a distance or ensures a motor-speed. This force, however, doesn’t always instantaneously fix the constraint. Although it usually happens very fast, it can happen over time.
This time lag can lead to joints ‘stretching’ or seeming ‘soft’. The lag happens because the physics system is trying to apply joint-forces to fix constraints, whilst at the same time other game physics forces are acting to break constraints. In addition to the conflicting forces acting on game objects, some joints are more stable and react faster than others.
Whatever constraints the joint provides, the joint only uses forces to fix the constraint. These are either a linear (straight line) force or angular (torque) force.
HINT: Given the conflicting forces acting on joints, it is always good to be cautious when applying large forces to rigid body objects that have joints attached, especially those with large masses.
All joints have the ability to stop working completely (that is break) when a force exceeds a specified limit. The limit that causes breaking due to excessive linear force is called the “break force”. The limit that causes breaking due to excessive torque force is called the “break torque”.
Both these limits are pre-set to Infinity: This means that they have no limit.
When a Break Force or Break Torque limit is exceeded, the joint breaks and the component deletes itself from its GameObject.
When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
More information
These cookies enable the website to provide enhanced functionality and personalisation. They may be set by us or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.
These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising. Some 3rd party video providers do not allow video views without targeting cookies. If you are experiencing difficulty viewing a video, you will need to set your cookie preferences for targeting to yes if you wish to view videos from these providers. Unity does not control this.
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.