Hello veryone. For some odd reason my animation won’t play when I press the right arrow key. I don’t get it whats wrong?
Here’s how my code looks.
BTW! I’M USING
C# / C SHARP
// Update is called once per frame
void Update () {
if (Input.GetKey ("right")) {
animation.Play("Run");
}
if (Input.GetKey ("left")) {
float move = Input.GetAxis ("Horizontal");
rigidbody2D.velocity = new Vector2 (move * MaximumSpeed, rigidbody2D.velocity.y);
if (move > 0 && !FacingRight)
Flip ();
else if (move < 0 && FacingRight)
Flip ();
}
}