FrictionJoint2D
Applies both force and torque to reduce both the linear and angular velocities to zero.
Read time 7 minutesLast updated 5 days ago
Definition
- Type: Class
- Namespace: UnityEngine
- Assembly: UnityEngine.Physics2DModule
- Inherits from: AnchoredJoint2D
public sealed class FrictionJoint2D : AnchoredJoint2D
Remarks
The joint constantly tries to reduce both the ::Rigidbody2D::velocity and ::Rigidbody2D::angularVelocity to zero. Unlike contact friction which requires two colliders to be in contact, force and torque here are applied continuously.
You can control both the maximum force using FrictionJoint2D.maxForce and maximum torque using FrictionJoint2D.maxTorque. Because you can use very high force or torque limits, you can essentially reduce an objects movement to almost zero.
A typical usage for this joint might be to simulate top-down surface friction or to simulate stiff rotation of an object.
Properties
Property | Description |
|---|---|
| maxForce | The maximum force that can be generated when trying to maintain the friction joint constraint. |
| maxTorque | The maximum torque that can be generated when trying to maintain the friction joint constraint. |
Inheritance
Operators
Operator | Description |
|---|---|
| operator == | Compares two object references to see if they refer to the same object. |
| bool | Determines whether the object exists. |
| operator != | Compares if two objects refer to a different object. |