Version: 2021.3
LanguageEnglish
  • C#

Joint2D.breakForce

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public float breakForce;

Description

The force that needs to be applied for this joint to break.

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 OnJointBreak2D 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 GetReactionForce.

The break force can be set to Mathf.Infinity to make the joint unbreakable by any amount of reaction force. You should use this if you never intend for the joint to break with force as it indicates that the joint should not be checked each physics update, therefore provides better overall performance.

Additional resources: reactionForce, GetReactionForce & OnJointBreak2D.