hi all,
how to connect and disconnect the two objects using key.space and hingeJoint
or otherwise
Please help, I have no ideas
from other question
how attach 2 object eg. tractor and trailer.
“hingeJoint.connectedBody” not work bcs trailer attach each side
var otherBody : Rigidbody;
function OnCollisionEnter (collision : Collision) {
if (collision.rigidbody){
hingeJoint.connectedBody = otherBody;
print("ho");
}
}
function Update () {
if (Input.GetKey(KeyCode.Z)){
hingeJoint.connectedBody = null;
print("hi");
}
}