Switching materials on Trigger Enter

Hi, I tried to make a script who changes the material of a mesh when it enters in the trigger of a sphere. This is the script i I made:

var newMat : Material;
function OnTriggerEnter (other : Collider) {
if(other.tag == "Sphere") {
print("Enter");
renderer.material = newMat;}}

But for some reasons it doesn't work;

what do you think about it?

It's backwards. OnTriggerEnter is for an object that has a trigger collider. You'd attach the script to the sphere.

var newMat : Material;

function OnTriggerEnter (other : Collider) {
    if (other.CompareTag("The Thing That Is Not The Sphere")) {
        print("The thing that is not the sphere entered the sphere's trigger collider.");
        other.renderer.material = newMat;
    }
}

If you, like me, are looking for a C# answer to this:

    public Material newMat;
    public GameObject objectToChange;

    void OnTriggerEnter()
     {
        objectToChange.GetComponent<MeshRenderer>().material = newMat;
        Debug.Log("Exito");
     }