- Home /
Question by
WeirderChimp · Apr 11, 2015 at 04:11 AM ·
physicsjointconfigurablejoint
Calling OnJointBreak on Connected body
Hey so im wondering how to call on joint break on the connected body when a joint breaks. also if i have 2 joints calling it on the correct connected body of the joint that broke
Thanks ~Scott
Comment
Answer by Pendrokar · Mar 08, 2016 at 01:42 PM
First part(if C# and only one joint on GameObject):
void OnJointBreak ()
{
Joint brokenJoint = gameObject.GetComponent<Joint>();
ScriptName cScript = brokenJoint.connectedBody.gameObject.GetComponent<ScriptName>();
cScript.connectedBodyFunctionName();
}
Your answer
Follow this Question
Related Questions
Using a ConfigurableJoint to move an object to a postion and rotation. 0 Answers
OnJointBreak 1 Answer
How to apply joint's inverse forces to another body 1 Answer
How can I make a configurable joint behave like a spring joint? 0 Answers
Violent shaking when using position drive in Configurable Joints 1 Answer