How do I rotate player based on mouse speed?

If the speed is constant, the player can’t like look back really fast. My code lets the player rotate based on if mouse is moving to the left or the right and that’s not what I want.

How do I make it so speed of mouse affects the rotation speed?

void MovePlayer()
        float horizontalInput = Input.GetAxis("Horizontal");
        float verticalInput = Input.GetAxis("Vertical");

        if (Input.GetAxis("Mouse X") < 0)
            transform.Rotate(Vector3.up * -turnSpeed * Time.deltaTime);
        if (Input.GetAxis("Mouse X") > 0)
            transform.Rotate(Vector3.up * turnSpeed * Time.deltaTime);

        transform.Translate(Vector3.forward * speed * verticalInput * Time.deltaTime);

If I understand you correctly, you want the player to be able to control how fast they swing around by swiping their mouse more/less.

If that’s what you want you could do something like this:

float mouseSensitivity = 2f;

float mouseX = Input.GetAxis("Mouse X");

transform.Rotate(Vector3.up * mouseX * mouseSensitivity);

Thank you, that worked.