Hi!,
I am making a FPS game but my walk animation won't work, when i press W,A,S, or D, my gun just jerks
heres my script(In javascript):
function Update() {
if (Input.GetKeyDown(KeyCode.W)) {
GetComponent.().CrossFade("Walk");
}
else if (Input.GetKeyDown(KeyCode.A)) {
GetComponent.().CrossFade("Walk");
} else if (Input.GetKeyDown(KeyCode.S)) {
GetComponent.().CrossFade("Walk");
} else if (Input.GetKeyDown(KeyCode.D)) {
GetComponent.().CrossFade("Walk");
}
else {
GetComponent.().CrossFade("idle");
}
}
So, like I said, My idle animation will play, but when I press WASD, it just has the gun jerk, then okays the idle again, even if I hold WASD.
thanks.
↧