- Home /
Why is my OnJointBreak() not working?
In my game it is possible to knock a sword out of someone's hand by breaking the hinge joint connecting them. When the joint breaks I want a certain variable to be set to false. But the OnJointBreak function is never called, even though I can see the joint break in the Inspector.
plz help
this is my code
void OnJointBreak (float breakForce)
{
Debug.Log("A joint has just been broken!, force: " + breakForce);
}
edit: I did some more testing and found that the OnJointBreak isn't called when a joint is broken like it's supposed to. It can only be called manually for some reason. I haven't updated to the latest version of Unity, could that have something to do with it.
Comment
the script is attached to the game object that has the joint.