//Checks if the left and right keys are pressed and flips the player accordingly
//Make sure the player scale on the x axis is 1
//Checks if the right key is pressed
if (moveHorizontal > 0)
{
rb2D.transform.localScale = new Vector3(1, transform.localScale.y, transform.localScale.z);
}
//Checks if Left Key is pressed
else if (moveHorizontal < 0)
{
rb2D.transform.localScale = new Vector3(-1, transform.localScale.y, transform.localScale.z);
}