For some reason when i try to use this code in game, it only plays the animations for Axis' "AA" and "DD" and Ive been working on it for hours and i cant see to fix that issue, can anyone help?
function Update (){
if (Input.GetAxis("WW"))
animation.CrossFade("WMotion");
if (Input.GetAxis("SS"))
animation.CrossFade("SMotion");
if (Input.GetAxis("AA"))
animation.CrossFade("AMotion");
if (Input.GetAxis("DD"))
animation.CrossFade("DMotion");
if (Input.GetButtonDown ("Fire1"))
animation.CrossFade("SWswing");
`Input.GetAxis` returns a float, thus your if-s should always return `true` because there is a value returned. I think you might need something like this:
It seems like you want something like an animation control, so this might be a solution.
On the other hand, if you want buttons to control (WASD just to toggle the animations), you should use `Input.GetButtonDown` like you did for the Fire button.