Trigger Help

I want my animation to play on entering a trigger and play another on exiting it…
need help

CODE:

var IsRunning = false;
var RunAnim : AnimationClip;
var IdleAnim : AnimationClip;
var Player : String;
var Me : Transform;

  

function OnTriggerEnter( other : Collider ) {
    Debug.Log("Come Get Me");
    if (other.tag == Player) 
    {
        IsRunning = true;
		Me.animation.Play = (RunAnim);
    }
}


function OnTriggerExit( other : Collider ) {
    Debug.Log("I Ran away!");
    if (other.tag == Player) 
    {
        IsRunning = false;
		Me.animation.Play = (IdleAnim);
    }
}

Alternate code:

var IsRunning = false;
var RunAnim : AnimationClip;
var IdleAnim : AnimationClip;
var Player : String;
var Me : Transform;

  

function OnTriggerEnter( other : Collider ) {
    Debug.Log("Come Get Me");
    if (other.tag == Player) 
    {
        IsRunning = true;
		//Me.animation.Play = (RunAnim);
    }
}


function OnTriggerExit( other : Collider ) {
    Debug.Log("I Ran away!");
    if (other.tag == Player) 
    {
        IsRunning = false;
		//Me.animation.Play = (IdleAnim);
    }
}

function Awake()
{

if (IsRunning == true)
{
AnimationClip.Play = (RunAnim);
}

else 
{
AnimationClip.Play = (IdleAnim);
}

}

Use the first one but use this to call the play function properly:

Me.animation.Play(IdleAnim.name);

Also make sure that the animationclip has been added to the Animation component.

Thanks GameVortex!
It works!
For anyone who needs the script for animation trigger

var IsRunning = false;
var RunAnim : AnimationClip;
var IdleAnim : AnimationClip;
var Player : String;
var Me : GameObject;

  

function OnTriggerEnter( other : Collider ) {
    Debug.Log("Come Get Me");
    if (other.tag == Player) 
    {
        IsRunning = true;
		Me.animation.Play(RunAnim.name);
    }
}


function OnTriggerExit( other : Collider ) {
    Debug.Log("I Ran away!");
    if (other.tag == Player) 
    {
        IsRunning = false;
		Me.animation.Play(IdleAnim.name);
    }
}