GameObjects pass through each other when they are connected with configurable joint
Any idea about why this thing happens?
private void MakeConnection(GameObject pullingObject, GameObject pulledObject, Vector3 connectedAnchor,Vector3 anchor)
{
ConfigurableJoint jointOfpullingObject;
if(pullingObject.GetComponent<ConfigurableJoint>() == null)
{
jointOfpullingObject = pullingObject.AddComponent<ConfigurableJoint>();
}
else
{
jointOfpullingObject = pullingObject.GetComponent<ConfigurableJoint>();
}
//Motion constraints
jointOfpullingObject.connectedBody = pulledObject.GetComponent<Rigidbody>();
jointOfpullingObject.xMotion = ConfigurableJointMotion.Limited;
jointOfpullingObject.zMotion = ConfigurableJointMotion.Limited;
//Linear limit
SoftJointLimit limit = jointOfpullingObject.linearLimit;
limit.limit = linearLimit;
jointOfpullingObject.linearLimit = limit;
//Joint anchors
jointOfpullingObject.autoConfigureConnectedAnchor = false;
jointOfpullingObject.connectedAnchor = connectedAnchor;
jointOfpullingObject.anchor = anchor;
}
Comment
Answer by orch · Dec 04, 2019 at 09:34 AM
i have the solution. i had forgotten to set jointOfPullingObject's enableCollision property true.
Your answer
![](https://koobas.hobune.stream/wayback/20220612215632im_/https://answers.unity.com/themes/thub/images/avi.jpg)