Hello, I have a running animation imported and when I hold down A or D it works fine but I can just mash it and it looks janky. Please help :(
if (!m_Anim.GetCurrentAnimatorStateInfo(0).IsName("Slashing"))
{
if (Input.GetKey(KeyCode.Mouse0))
{
if (Input.GetKey(KeyCode.D) && isGrounded)
{
Attack();
m_Anim.Play("Run Slashing");
}
else if (Input.GetKey(KeyCode.A) && isGrounded)
{
Attack();
m_Anim.Play("Run Slashing");
}
else
{
Attack();
m_Anim.Play("Slashing"); // this works perfectly
}
}
[link text][1]
[1]: https://youtu.be/BSwlrVRFfEs
↧