Destroy(GetComponent) not work :S

var Rd:GameObject;
function Update ()
{
if(!Rd==null){
Destroy(GetComponent(“LevelManager”));
}
}

it is not working guys :S how can fixed it :slight_smile:

I assume you are trying to remove the component LevelManager from the GameObject Rd.

To do so, go like this:
var Rd : GameObject;

function Update () {
    if(Rd!=null)
    {
        Destroy(Rd.GetComponent(LevelManager));
    }
}