Setting a value to 0 in a short time instead of instantly

Hi,

I’m trying to make some sort of 1’st person Flying simulator.
I have the controls working (kinda), but when the player releases the control stick on the controller, the ship stops rotating immediately.
How do I let it quickly slow down the rotation instead of instantly setting it to 0?

Code:

        // Controller controlls
    if (useController)
    {
        if (Input.GetKey(KeyCode.Joystick1Button0))
        {
            rb.velocity = transform.forward*thrustForce*Time.deltaTime;
        }

        horizontalRotation += Input.GetAxis("Horizontal") * horizontalSensetivity * Time.deltaTime;
        verticalRotation += Input.GetAxis("Vertical") * verticalSensetivity * Time.deltaTime;
        strafeRotation += Input.GetAxis("controllerBumpers") * strafeSensetivity * Time.deltaTime;

        if (Input.GetAxis("Horizontal") == 0)
        {
            horizontalRotation = 0;
        }

        if (Input.GetAxis("Vertical") == 0)
        {
            verticalRotation = 0;
        }

        if (Input.GetAxis("controllerBumpers") == 0)
        {
            strafeRotation = 0;
        }
    }
    
    Debug.Log(shipRotation);
    
   transform.Rotate(shipRotation);

Check out the settings for that axis in the Edit->Project Settings->Input window. You can adjust the gravity variable, which determines how quickly it resets to zero.

Alternately, you can try some form of interpolation.