Flipping 2D charcter?

Im making aplatformer and my when i try to make it so that the character flips on the x when i move left but for some reason its not working. this is my code

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMovement : MonoBehaviour
{
    public float moveSpeed;
    public float jumpForce;
    private Rigidbody2D rb2d;
    bool facingRight = true;
    // Start is called before the first frame update
    void Start()
    {
        rb2d = GetComponent<Rigidbody2D>();
    }


    public Animator animator;

    void Update()
    {

        animator.SetFloat("Horizontal", Input.GetAxis("Horizontal"));

        float moveInput = Input.GetAxisRaw("Horizontal");
        Scale.position += new Vector3 (moveInput, 0, 0) * moveSpeed * Time.deltaTime;

        if (Input.GetKeyDown(KeyCode.Space) && Mathf.Abs(rb2d.velocity.y) < 0.001f)
        {
            rb2d.AddForce(new Vector2 (0, jumpForce), ForceMode2D.Impulse);
        }

        if(inputHorizontal > 0  && !facingRight)
        {
            Flip();
        }
        else if(input.horizontal < 0 && facingRight)cale
        {
            Flip();
        }
    }

    void Flip()
    {
        Vector3 currentScale = gameObject.transform.localScale;
        currentScale.x *= -1;
        gameObject.transform.localScale = currentScale;

        facingRight = !facingRight;
    }
}

sorry if this script is pasted wropng im new to unity
thankyou

To prevent bugs it’s best to check something directly rather than going through a bool that may or may not represent what you’re wanting to check for.

So like this:

if (inputHorizontal > 0  && transform.localScale.x<0)
    Flip();
else if (input.horizontal < 0 && transform.localScale.x>0)
    Flip();

Thankyou but this didnt work once i added the code i was still geting these error messages

-PlayerMovement.cs(26,9): error CS0103: The name 'Scale' does not exist in the current context
-PlayerMovement.cs(33,13): error CS0103: The name 'inputHorizontal' does not exist in the current context
-PlayerMovement.cs(37,18): error CS0103: The name 'input' does not exist in the current context

if theres any way you could help that would be amazing

using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
public float moveSpeed;
public float jumpForce;
private Rigidbody2D rb2d;
public Animator animator;

    void Start()
    {
        rb2d = GetComponent<Rigidbody2D>();
    }

    void Update()
    {
        animator.SetFloat("Horizontal", Input.GetAxis("Horizontal"));
        if (Input.GetKeyDown(KeyCode.Space) && Mathf.Abs(rb2d.velocity.y) < 0.001f)
        {
            rb2d.AddForce(new Vector2 (0, jumpForce), ForceMode2D.Impulse);
        }
    }

    void FixedUpdate()
    {
        float moveInput = Input.GetAxisRaw("Horizontal");
        if (moveInput > 0 && transform.localScale.x < 0) 
        {
            Flip();
        }
        else if (moveInput < 0 && transform.localScale.x > 0)
        {
            Flip();
        }
        rb2d.AddForce(new Vector2(moveInput * moveSpeed, 0));
    }

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

Thankyou this worked