Clamp not working/clamping too much

I don’t really know how to describe my problem, I’ve looked at a few other “Clamp not working” threads and none seem to be my specific problem. I’m trying to clamp my camera on the Y-axis, standard stuff for a first person game. But whenever I go to test it, it doesn’t let me move my camera vertically. Here is my code :

{
    public Transform cam;

    public float mouseSensitivity;
    private float horizontal;
    private float vertical;
    private float mouseHorizontal;
    private float mouseVertical;
    private Vector3 velocity;
    float mouseVerticalt = 0;
    private void Update()
    {
        PlayerInput();

        
        mouseVerticalt -= mouseVertical;
        transform.Rotate(Vector3.up * mouseHorizontal);
        cam.transform.localRotation = Quaternion.Euler(mouseVerticalt, 0f, 0f);
        mouseVerticalt = Mathf.Clamp(mouseVerticalt, -90f, 90f);
        Debug.Log("Clamp" + mouseVerticalt);
        Debug.Log("Vertical" + mouseVertical);

    }

My camera is parented to my player object if that helps, and assigned in the inspector.

Don’t set MouseVerticalt to 0 every update, you want to let it be free to accumulate its value over multiple frames. Just get rid of that line and your code should work.

Also if you leave an empty line before you insert code
**
Like this
**
Your code will be properly formatted

This is how code will look when you leave a blank like before inserting

And This is how code will look when you don't leave a blank line