To detect when the force or torque on a constraint exceeds a threshold, use the Callbacks section of the Physics Constraint component. Unity calls a method or sets a parameter when the constraint exceeds the threshold you set.
Note: This documentation is about using Pose, Area, and Constraint components. To use 2D physics in the Unity Editor using components like the Rigidbody 2D component, refer to 2D physics instead.
To detect when a constraint’s force or torque exceeds a threshold, follow these steps:
Unity now calls the method or sets the parameter whenever the constraint’s force or torque crosses the threshold you set.
To detect the same event using a script instead of the Inspector, refer to PhysicsConstraintCallbacks.IJointThresholdCallback or PhysicsCallbacks.IJointThresholdCallback in the U2D.Physics API.
For more information about the Callback Source and Event settings properties, refer to a constraint’s component reference page, for example Physics Constraint Distance component reference.
To check whether a constraint’s event fired, expand Info > Callbacks in the Physics Constraint component, and check the Joint Threshold value. This value counts how many times Unity dispatched the event to a valid receiver.