ON hit remove

I have a cube, and when a Sphere hits it I want it to get removed, but it isn’t working! I’ve tried it in C# and Java, but neither will work! Here is my java version:

function OnTriggerEnter(other : Collider){

Destroy(gameObject);

}

and here is my C# version:

using UnityEngine;

using System.Collections;

public class Cube Die : MonoBehaviour {

void OnTriggerEnter () {
	Destroy(gameObject);	
}

}

I’ve tested the javascript code and it worked fine. Have you set Is Trigger in the cube collider? Have you attached this script to the cube object? If so, the cube should disappear when some rigidbody or character controller collides with it. One more question: is the sphere a rigidbody or character controller? If it is a character controller, it will not be detected if moved with Translate - only CharacterController’s 1 or SimpleMove ensures it will be detected.