Show running animation by going either direction?

Hi guys! First time here! Thanks for having me. Anywho, I’ve ran into a problem where my character object is only showing their run animation when I move up and down. I’m trying to show the run animation by going left and right as well. Thanks in advance… Here is my code…

public class PracPC : MonoBehaviour {

public float maxSpeed = 10f;
bool facingRight = true;

Animator anim;

// Use this for initialization
void Start () {
anim = GetComponent ();

}

void Update ()
{

}

// Update is called once per frame
void FixedUpdate () {

float moveup = Input.GetAxis (“Vertical”);
float moveright = Input.GetAxis (“Horizontal”);
anim.SetFloat (“Speed”, Mathf.Abs (moveright));
anim.SetFloat (“Speed”, Mathf.Abs (moveup));
GetComponent().velocity = new Vector2(moveupmaxSpeed, GetComponent().velocity.y);
GetComponent().velocity = new Vector2(moveright
maxSpeed, GetComponent().velocity.x);
if (moveright > 0 && !facingRight)
Flip ();
else if (moveright < 0 && facingRight)
Flip ();

}

void Flip()
{
facingRight = !facingRight;
Vector3 theScale = transform.localScale;
theScale.x *= -1;
transform.localScale = theScale;
}
}

There could be a dozen of points to look at, but as a starting point, I feel that these lines in FixedUpdate are suspicious

anim.SetFloat (“Speed”, Mathf.Abs (moveright));
anim.SetFloat (“Speed”, Mathf.Abs (moveup));

You will end up setting the speed parameter to the value from Up/Down every time FixedUpdate is called.

Thanks. I’ll check on that.