Say I have 500 GameObjects with Hinge Joint components and I would like to know when their joints break … but I would very much like to avoid adding another 500 MonoBehaviours to the scene with the sole purpose of getting access to the local OnJointBreak() calls.
Is there any way I can be noticed globally by the physics engine when a joint breaks?
I don’t think there is any global OnJointBreak equivalent. I guess you could use GameObject.AddComponent to add a detection script to each hinge object. This would avoid the manual effort of attaching the scripts, but maybe you are more concerned about the runtime overhead?
Sorry if I was unclear. No I wasn’t thinking of manually attaching 500 scripts in the first place (just take a little moment to contemplate the pain). =)