I'm confused with the animator

So I’ve got multiple animations and if I press the right button it would transform from Idle State to
Right. So here’s my script;

private var speed : float = 3;
private var speed2 : float;
var character : GameObject;
var isBack : boolean;
var isLeft : boolean;
var isRight : boolean;
var isIdle : boolean;
var isFront : boolean;
var Animator : Animator;
private var hit : RaycastHit2D;

function Update () {
	BlahBlah ();
	if(Input.GetMouseButtonDown(0)) {
		hit = Physics2D.Raycast(camera.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);
		if( hit.collider.gameObject.name == "Right")
    	{
    		speed2 = 1;
    		Debug.Log("Clicked");
    		isRight = true;
			Animator.SetBool("isRight", isRight);
			Animator.SetFloat("speed", speed2);
			BlahBlah ();
    	}
	}
	if(Input.GetMouseButtonUp(0)) {
		isRight = false;
		isIdle = true;
		speed2 = 0;
	}
}
  
function BlahBlah () {
	if(isRight == true) {
		character.transform.position.x = character.transform.position.x += 1.25 *(speed * Time.deltaTime);
	}   	
}

So in the animator, I’ve set the condition of the transition from right to idle to
*isIdle is true
*isRight is false
*speed is less than 0.01
[34879-screen+shot+2014-11-09+at+10.42.22+am.png|34879]

but when I released the button it would stop moving along the x axis but it would continue to play the Right animation instead of transitioning to Idle. I don’t know whats wrong with this scriptt here.

Edit: Found the answer(By myself) it was because I didn’t sign the isIdle variable boolean to the animator boolean. I forgot to put Animator.SetBool (“isIdle”, isIdle)

In your if(Input.GetMouseButtonUp(0)) {}, you don’t ever set the Animator conditions again. I suspect you meant something like:

if(Input.GetMouseButtonUp(0)) {
  isRight = false;
  isIdle = true;
  speed2 = 0;
  Animator.SetBool("isRight", isRight);
  Animator.SetFloat("speed", speed2);
}