Problem with object destroy

I made a little script wich should destroy a cube when walking trough it (with the FPS Controller) but what happens is that it destroys the fpscontroller instead of the cube, anyone got any idea how to solve this?

Here's my script:

var feather : Transform ;

function OnTriggerEnter (feather : Collider) { Destroy(feather.gameObject); }

Hey,

the problem is that you're defining feather as the collider which enters the trigger. you're saying: the variable "feather" will be the Collider that enters this trigger.

So in your case you could try something like this (untested):

var feather : Transform;

function OnTriggerEnter () 
{
    Destroy(feather.gameObject);
}

cheers!

PS: here is the link to the docs for this

Here's my script:

var feather : Transform ;

function OnTriggerEnter (feather : Collider) { Destroy(feather.gameObject);

}

In above I think

1) change the name of variables outside of function to some other than "feather"

2) check if this script is attached with gameObject you are destroying