How can I make a rigidbody stop with the user input and ignore its kinetic energy?

My goal is to move the character (currently a capsule) at constant/fixed speed in the direction the player wants to. When the player stops giving inputs, the character should instantly stop moving, however it currently keeps “sliding away” when I drop inputs because it has gained kinetic energy. How can I make it ignore that energy and stop it right away?


Controller script:

    // the player willingly moves and rotates according to camera rotation 
    // I have also set constraints on the X and Z rotation values on the rigidbody component
    // this is a third person view game
    private void FixedUpdate()
    {
        rotate();
        Vector3 vert = getAxis("Vertical") * cameraTransform.forward;
        Vector3 horz = getAxis("Horizontal") * cameraTransform.right;
        rb.AddForce((vert + horz).normalized * speed, ForceMode.Impulse);
    }

    // todo: look towards the movement vector, reset to camera fwd when there is no movement
    void rotate()
    {
        Vector3 lookpos = transform.position + cameraTransform.forward;
        lookpos.y = transform.position.y;
        transform.LookAt(lookpos);
    }

    int getAxis(string name)
    {
        return Input.GetAxisRaw(name) > 0 ? 1 : Input.GetAxisRaw(name) < 0 ? -1 : 0;
    }

Properties of the character’s rigidbody:

alt text

I have also attached a Physics Material to the character’s Capsule Collider:

alt text

rb.velocity = Vector3.zero;