breakForce
The force that needs to be applied for this joint to break.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Property
- Namespace: UnityEngine
- Assembly: UnityEngine.Physics2DModule
public float breakForce { get; set; }
Remarks
When a joint tries to constrain a Rigidbody2D it may need to apply a force to do so. This is known as the reactionForce. Each physics update, the breakForce is compared to the size of the reactionForce; if it exceeds it then Joint2D.OnJointBreak2D(Joint2D) is called with a reference to the joint that broke. Knowing the joint that broke, you can check the actual reaction force that broke the joint using reactionForce or Joint2D.GetReactionForce.
The break force can be set to Mathf.Infinity to make the joint unbreakable by any amount of reaction force. Alternately, setting the breakAction to JointBreakAction2D.Ignore will make the joint unbreakable by either breakForce or breakTorque.
The action taken when a joint exceeds the breakForce is controlled by breakAction.
Additional Resources: Joint2D.reactionForce, Joint2D.GetReactionForce & Joint2D.OnJointBreak2D(Joint2D).