Can you help with the character controller

The bottom line is that the character would move around the object with horizontal input. And during the vertical input, the character moved forward.

My code example

Vector3 direction = transform.forward * _moveDirection.y + transform.right * _moveDirection.x;
        Vector3 targetDirection = _targetPosition.position - transform.position;
        Vector3 rotationDirection = Vector3.RotateTowards(transform.forward, targetDirection, 360, 0.00f);
        Quaternion targetRotation = Quaternion.LookRotation(rotationDirection);
        float xAngleError = Mathf.DeltaAngle(transform.rotation.eulerAngles.y, targetRotation.eulerAngles.y);
        float xTorqueCorrection = _pid.GetOutput(xAngleError, Time.deltaTime);
       
        transform.rotation = Quaternion.Euler(xTorqueCorrection * Vector3.up);
        _characterController.Move(direction.normalized * (_walkSpeed * Time.deltaTime));

but due to centrifugal force, the character flies out of the playing field.

Please help me!

I have no idea what is going on in the code above. I see nothing to do with centrifugal forces.

If you’re just looking for a character movement script, here is a super-basic starter prototype FPS based on Character Controller (BasicFPCC):

https://discussions.unity.com/t/855344

That one has run, walk, jump, slide, crouch… it’s crazy-nutty!!