JointBreakSignalSource¶
Forwards Unity's OnJointBreak callback as a signal pushed into a Reactor.
Namespace: Jungle.Physics
Inherits: MonoBehaviour
Overview¶
Add this component to the same GameObject that owns the joint — Unity routes OnJointBreak callbacks to MonoBehaviours on the joint's GameObject. When the joint breaks (its breakForce / breakTorque is exceeded), this component:
- Pushes the configured
SignalTypeinto a target Reactor. - Invokes a local
UnityEvent<float>with the break force, so you can wire it to anything that takes a float (e.g. aSetFloator a DataStorage write to capture the break force).
If the Reactor reference is left empty, the component searches for one on the same GameObject (and optionally parents/children).
Properties¶
| Property | Type | Description |
|---|---|---|
| reactor | Reactor |
Reactor that receives the signal. If empty, searched for on this GameObject and (optionally) parents/children. |
| searchParents | bool |
Search parents for a Reactor when the explicit reference above is empty. |
| searchChildren | bool |
Search children for a Reactor when the explicit reference above is empty. |
| signal | SignalType |
Signal pushed into the Reactor when the joint breaks. Leave empty to skip the Reactor dispatch and only fire the local event. |
| onBroken | UnityEvent<float> |
Invoked locally with the break force after the signal has been dispatched. |