void FixedUpdate() {
if(Input.GetKey(left))
{
gameObject.GetComponent<Rigidbody2D>().velocity = Vector2.left * speed;
transform.localScale = new Vector2(-8, 8);
gary.SetInteger("Is walking", 1);
}
if(Input.GetKey(right))
{
gameObject.GetComponent<Rigidbody2D>().velocity = Vector2.right * speed;
transform.localScale = new Vector2(8, 8);
gary.SetInteger("Is walking", 1);
}
else
{
gary.SetInteger("Is walking", 0);
}
when the player pushes left or right its supposed to move them in that direction and
play the walking animation VIA setting the transition parameter for idle to walk to 1. But for some reason the parameter only changes when the right button is pressed, i tried adding in a 3rd option that turned the parameter on when the player hit space, and placed it below the second if statement, and then for some reason the second if statement wouldent change the parameter and only the third one would.
So is this a bug or am i doing it wrong, can you not have multiple if statements that change an animation parameter?