Player Animation HELP NEEDED

Hi i just finished making an animation of a person walking and named it “walking”
I also made an animation of a person standing still
if have this code so far but the stand still doesnt work :confused:
`var Walk : String = “Walking”;
var stand : String = “stand”;
function Start () {

}

function Update () {
if (Input.GetKeyDown (“w”))
{
gameObject.animation.CrossFade(Walk);
}
else if (Input.GetKeyUp (“w”))
{
gameObject.animation.CrossFade(stand);
gameObject.animation.Play(stand);
}
}`

Try getting rid of your animation.Play(stand) line. The CrossFade should already be playing the animation.

Also, two things: 1) There really isn’t any point to declaring string variables when you could just access the animations like so: animation.CrossFade(“Walking”). 2) You don’t need gameObject in front of your animation lines.

Hope that helps, Klep