destroy hinge joint component from another object in javascript

Hi, you’ll see, i have this code, i need to destroy a hinge joint component of a door from the script of a trigger, but when i run the code, it erases the entire door, what am doing wrong or what can i do? i don’t want to have a script per door because there are so many of them :I

#pragma strict
var levelStuff : GameObject;
var activar : boolean;
var mustKill : boolean = false;
var doorToKill : GameObject;
var killLevel : GameObject;
var createSomething : boolean = false;
var somethingToCreate : GameObject;

function Start () {

}

function Update () {

}

function OnTriggerEnter(col : Collider)
{
	    if(col.gameObject.tag == "personaje")
	    {
	    	if (activar == false)
	    	{
			levelStuff.SetActive (false);
	    	Debug.Log("borrado");
	    	}
	    	if (activar == true)
	    	{
	    	levelStuff.SetActive (true);
	    	Debug.Log("dibujado");
	    	}
	    	
	    			if (mustKill == true)
	    			{
	    				Debug.Log("puerta cerrada");
	    				Destroy(doorToKill.GetComponent(HingeJoint)); //<- this is the problem, i think :I
	    				Destroy(killLevel);
	    			}
	    			
	    			if (createSomething == true)
	    			{
	    				somethingToCreate.SetActive(true);
	    			}
	    	
	    }
	    

}

Thnks :b

Just a quick thought, but have you tried commenting out the Destroy(killLevel) line to see if it still destroys the door. Is it possible that your door is a child of what is assigned to killLevel? Also, if this doesn’t work, have you tried commenting out both lines to ensure that some other code isn’t destroying the door?

oh, i found out what happens: when i destroy the hinge joint, the door falls down… if i also freeze it’s rotation & position it should work as i intend, right? to block the door so you can’t enter… Thnks :b