destroy fixedJoint script help plz.

Hi i have trouble destroying my fixed joint.

I have a child with an fixed joint on it and the joint attaches to an cube. Like a crane hook/magnet.

i made this so far. I runs but nothing happens … I tried lots of different ways to make this work. I can get the whole magnet do be destroyed but thats not what i want. :frowning:

if(Input.GetKeyDown(KeyCode.E)){
                                      var DropCargo = GameObject.Find("Magnet"); // finds my object named Magnet
					//DropCargo.GetComponent(FixedJoint);     // not in use //gives the magnet a fixedjoint
					DestroyObject(DropCargo.FixedJoint); // Destroy the joint 
					print("Attemts to release cargo");  // just so i know if i have connection with the function

}

Well what you should do is modify the fixed joint script instead of destroying it so

if(Input.GetKeyDown(KeyCode.E)){

var cargoScript = GameObject.Find(“Magnet”).FixedJoint;

cargoScript.connectedBody = null;
}

Hope this helps!