코드 그대로 옮겨서 구현하면 된다고 하셧는데

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

using UnityEngine.SceneManagement;

public class PlayerController : MonoBehaviour

{

    Rigidbody2D rigid2D;

    Animator animator;

    float jumpForce = 680.0f;

    float walkForce = 15.0f;

    float maxWalkSpeed = 1.5f;

    float xmax = 2.70f;

    float xmin = -2.70f;

    //float threshold = 0.2f;

    // Start is called before the first frame update

    void Start()

    {

        this.rigid2D = GetComponent<Rigidbody2D>();

        this.animator = GetComponent<Animator>();

    }

    public void LButtonDown()

    {

        int key = 0;

        if (transform.position.x < -2.7) transform.position = new Vector3(xmin, transform.position.y, 1);

        else key = -1;


        float speedx = Mathf.Abs(this.rigid2D.velocity.x);

        if (speedx < this.maxWalkSpeed)

        {

            this.rigid2D.AddForce(transform.right * key * this.walkForce);

        }

        if (key != 0)

        {

            transform.localScale = new Vector3(key, 1, 1);

        }

        if (this.rigid2D.velocity.y == 0)

        {

            this.animator.speed = speedx / 2.0f;

        }

        else

        {

            this.animator.speed = speedx / 2.0f;

        }


        if (transform.position.y < -10)

        {

            SceneManager.LoadScene("ClearScene");

        }

    }

    // Update is called once per frame

    void Update()

    {

        if (Input.GetKeyDown(KeyCode.Space)&&this.rigid2D.velocity.y==0) //점프

        {

            this.animator.SetTrigger("JumpTrigger");

            this.rigid2D.AddForce(transform.up * this.jumpForce);

            GetComponent<AudioSource>().Play();

        }

        int key = 0;

        if (Input.GetKey(KeyCode.RightArrow)) 

            if (transform.position.x > 2.7) transform.position = new Vector3(xmax, transform.position.y, 1); 

            else key = 1;


        if (Input.GetKey(KeyCode.LeftArrow))

            if (transform.position.x < -2.7) transform.position = new Vector3(xmin, transform.position.y, 1);

            else key = -1;


        float speedx = Mathf.Abs(this.rigid2D.velocity.x);

        if (speedx < this.maxWalkSpeed)

        {

            this.rigid2D.AddForce(transform.right * key * this.walkForce);

        }

        if(key != 0)

        {

            transform.localScale = new Vector3(key, 1, 1);

        }

        if (this.rigid2D.velocity.y == 0)

        {

            this.animator.speed = speedx / 2.0f;

        }

        else

        {

            this.animator.speed = speedx / 2.0f;

        }

        

        if (transform.position.y < -10)

        {

            SceneManager.LoadScene("ClearScene");

        }

        

        

    }

  

    private void OnTriggerEnter2D(Collider2D other)

    {

        Debug.Log("골");

        SceneManager.LoadScene("ClearScene");

    }

}


이렇게 구현했었는데 좌버튼을 눌러도 왼쪽만 보고 움직이지는 않더라구요 ㅠ