var Walk_Unarmed : AnimationClip;
function Update () {
if (Input.GetKeyDown (KeyCode.W)) {
animation.CrossFade("Walk(Unarmed)");
}
}
The animation does not play when I press W.
Any ideas?
var Walk_Unarmed : AnimationClip;
function Update () {
if (Input.GetKeyDown (KeyCode.W)) {
animation.CrossFade("Walk(Unarmed)");
}
}
The animation does not play when I press W.
Any ideas?
Double check that the animation is valid and that the script actually compiles.
From what you’ve show us, there is nothing wrong.
I did some debbuging and it appears the Input.GetKeyDown area is not working.
(I put a print (“hello”); before the animation.CrossFade and i never got a hello in the console)
OK. That’s helpful. I’m pretty sure that’s right though. Can you put something to Debug.Log in the Start()? Are you sure this is attached to an object?
i think you need not to use w key to play your walking animation. just do
if(Input.GetAxis("Vertical"))
{
transform.position += Vector3(0,0,Time.deltaTime);
animation.Play("walk");
}
the codes are not tested but i have done many time like this and its works for me everytime, if this also not work then check your animation setting.
0.o
I feel like an idiot lol
Earlier on when i was testing things in my script i had unchecked it.
And forgot to re-check it.
facepalm