move camera with mouse 1 to 1

I’m trying to set up a camera to ‘pan’ line in a graphics program. I started with this…

 public float dragSpeed = 1f;
 private Vector3 dragOrigin;

 if (!Input.GetMouseButton(0)) return;

        Vector3 pos = cam.ScreenToViewportPoint(Input.mousePosition - dragOrigin);
        Vector3 move = new Vector3(pos.x * dragSpeed, 0, pos.y * dragSpeed);

        transform.Translate(move, Space.World);

but it is ‘spongy’, there is a disconnect between the camera and the mouse. I would like a 1 to 1 relationship between the camera and the mouse. Can someone point me in the right direction? Thanks.

What is dragOrigin? By having a deltaPosition (position of mouse or cam last frame) then subtracting that from the position in the current frame, then changing the cams position by that much should work.

I updated the post with the variables, sorry about that. I’ll try your suggestion. Thanks.

the process should be in this order.

crntPos
deltaPos
setPos
lastPos

I couldn’t figure this out. Can you provide a little more detail? Thanks.