How to controll parameters in animator using javascript

I am having trouble with setting up the script here. All i want the character to do is when left shift is pressed set “isRunning” parameter to true and the the key is released go back to original state (idle). I tried using hash id but I couldn’t get it to work. Pls help me with the script:

#pragma strict

var anim : Animator;
var runHash : int = Animator.StringToHash("Run");


function Start () 
{
    anim = GetComponent("Animator");
}


function Update () 
{
    if(Input.GetKeyDown(KeyCode.LeftShift))
    {
        anim.SetTrigger (runHash);
    }
}

You don’t want a Trigger here. Try using a Bool instead – just make it transition back if the Bool is false.

if(Input.GetKeyDown(KeyCode.LeftShift))
  {
  anim.SetBool("isRunning",true);
  }

Then do the reverse for the “else” portion and you’re good.