Player collider stuck

I have a 3D animated player, I am using a rigidbody and a capsule collider.

Once I jump and move towards the side of the platform, my player just gets stuck. I tried looking for solutions, I found one solution which works for me.

if (!isGrounded() && Mathf.Abs(move) > 0.01f) return;

This stops my player from sticking to the wall. However, if the player gets right to the edge of the platform, he cant move.

My player control script

    public float runSpeed = 8f;
    public float jumpHeight = 8f;
    float force = 25f;
    Rigidbody rb;
    Animator anim;
    bool facingRight;
    float distToGround;

    void Start()
    {
        rb = GetComponent<Rigidbody>();
        anim = GetComponent<Animator>();
    }

    void FixedUpdate()
    {
        float move = Input.GetAxis("Horizontal");
        // Stops player sticking to wall
        if (!isGrounded() && Mathf.Abs(move) > 0.01f) return;

        if (move != 0f) anim.SetBool("isRunning", true);
        else if (move == 0f) anim.SetBool("isRunning", false);

        if (Input.GetKey("right")) rb.velocity = new Vector3(move * runSpeed, rb.velocity.y, 0);
        if (Input.GetKey("left")) rb.velocity = new Vector3(-move * -runSpeed, rb.velocity.y, 0);

        if (Input.GetButton("Jump") && isGrounded())
        {
            anim.SetTrigger("isJumping");
            rb.velocity = new Vector3(rb.velocity.x, jumpHeight, 0);
        }
    }
//Check if grounded
    bool isGrounded() { return Physics.Raycast(transform.position, -Vector3.up, distToGround + 0.1f); }

I am using a raycast to detect if grounded. I think when my capsule collider is just on the edge of platform it counts as not grounded, therefore he cant move.

Found a solution, its not great but it does the trick. I gave my capsule collider 0 friction physics. Then added a small sphere collider just at the tip of the feet/capsule collider. This gives my player friction on feet and none on his sides/top.

If anyone has another way, then a suggestion would be great. Thanks

The real solution would be to use a CharacterController unless you really need the physics side of things.

Yeah, I need to use the Rigidbody. I did have the CC but it made caused other problems with my game.