Hello, maybe i’m missing something simple here, but I cant seem to get my “firing” animation to play with 3 different button presses. I have it working so that when the spacebar is pressed, the animation plays and it works, but if I try to code in other buttons like leftshit, it doesnt work. Here’s the code:
public class animfire2 : MonoBehaviour {
Animator m_Animator;
bool Fire;
void Start () {
m_Animator = gameObject.GetComponent<Animator>();
Fire = false;
}
void Update () {
if (Input.GetKey (KeyCode.LeftShift))
Fire = true;
else
Fire = false;
if (Fire == false)
m_Animator.SetBool ("Fire", false);
if (Fire == true)
m_Animator.SetBool ("Fire", true);
}
}