How do I write the OnTriggerExit function to play an animation once I step off of the "switch button"?

I am trying to use a button model to activate different objects (platforms, lights, doors, etc…)in my scene. Once i step on the trigger object (button) my animation plays just fine. I want to play an animation to go back to the “idle” state once I step off of the button so I can deactivate the other objects, however I am uncertain how to write the OnTriggerExit function.

I can say from experience on here some folks are rude and make you feel stupid for asking such “elementary” questions so If you are going to be rude and make me feel stupid for asking then please just pass this post by. BUT for anyone who doesn’t mind explaining something to those of us who are wanting to learn, PLEASE help me out on this one.

#pragma strict

var buttonSound : AudioClip;
var pushButton : GameObject;



function OnTriggerEnter ( col : Collider)
{
	if (col.gameObject.tag == "Player")
	{
		AudioSource.PlayClipAtPoint (buttonSound, transform.position);
		pushButton.GetComponent.<Animation>().Play();
	}

}
function OnTriggerExit ( col : Collider)
{

}

Make sure you have a collider set to trigger on your button. Put a rigidbody on the player or the button and use this.

JS:

function OnTriggerExit(other : Collider){

//You need to specify what objects are effecting the trigger

if(other.gameObject.tag == "YourTag"){

	//Play Animation

}

}

CS:

void OnTriggerExit(Collider other){

if(other.gameObject.tag == "YourTag"){

	//Play Animation

}

}

Thank you for replying. It worked like a charm. I don’t know why I had such a hard time with something so easy.