function Start() { //set all animations to loop animation.wrapMode = WrapMode.Loop; animation.Stop(); } function Update () { if( Mathf.Abs(Input.GetAxis("Vertical")) > .1) { animation.CrossFade("walk"); } else animation.CrossFade("idle"); } @script RequireComponent(CharacterController)