I want to be able to have my array swicth when i hit the spacebar but it only work Once I tried other code like Push and Shift but it only work once also. So can someone tell me wants going on.
Note that GetButtonDown is only true during the frame the user pressed down the virtual button identified by buttonName. Thus, no matter how long you press the button, the array is reversed only once.
If this is not your problem, then use the debugger. Add a breakpoint at the line of code, where the array is reversed and check the content of the array before and after the execution of the line.
thank you for your answer I use the debugger break point it show me that the Reverse is work fine
however I have no idea what i doing worng I want my animation to change everyTime I hit the spaceBar but it only work once and that it never work again.
switch(wepon[0]){
case "shotGunHolding":
animation.Blend("shotGunHolding");
break;
case "machinGunHolding":
animation.Blend("machinGunHolding");
break;
case "holdingAPistorler":
animation.Blend("holdingAPistorler");
break;
}