private void FixedUpdate()
    {

   
        Vector3 forwardMove = transform.forward * speed * Time.fixedDeltaTime;
        Vector3 horizontalMove = transform.right * horizontalInput * speed * Time.fixedDeltaTime * horizontalMultiplier;
        rigid.MovePosition(rigid.position + forwardMove + horizontalMove);


    }


void Update()

    {

        //horizontalInput = Input.GetAxis("Horizontal");



        if (Input.touchCount > 0)

        {

            

            Touch touch = Input.GetTouch(0);




            // Handle finger movements based on TouchPhase

            switch (touch.phase)

            {

                case TouchPhase.Began:

                    startPos = touch.position;

                    break;


                case TouchPhase.Moved:

                    direction = touch.position - startPos;

                    if(direction.x > 0)

                    {

                        horizontalInput = 1f;

                    }

                    else

                    {

                        horizontalInput = -1f;

                    }

                    break;


                case TouchPhase.Stationary:

                    horizontalInput = 0f;

                    break;


                case TouchPhase.Ended:

                    break;


            }

            

        }


현재 만들고있는게 러너게임인데 모바일에서 터치하고 좌축으로 드래그하면 드래그한만큼 좌측으로 이동

우측으로 끌면 우측으로 이동 안움직이고 터치상태 가만히 있으면 계속 달리는 형태로 구현중인데..


update문에서 방향 관리하고

fixedupdate에서 달리가 방향틀어주기 등과 같은 움직임을 관리해주는중..


근데 이게 제대로 작동을 안하는데 왜그런걸까..