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);
}
}