This could be because your character sprite is not the same scale. Try this psuedo code instead.
void Flip(){
if(YourInput == TheInput || YourOtherInput == TheOtherInput etc){
transform.localScale = new Vector2(transform.localScale.x = -transform.localScale.x, transform.localScale.y);
}
else if(Your2ndInput == The2ndInput || YourOther2ndInput == TheOther2ndInput etc){
transform.localScale = new Vector2(Mathf.Abs(transform.Localscale.x), transform.localScale.y);
}
}