Optimizing Camera Dragging Movement

Hello, beginner here,

I’ve been making a drag-able camera for a top-down game, but each time I try to drag the camera, it snaps to the same location instead of moving based on where I clicked.
I had followed this tutorial from Matt Apsland : https://youtu.be/s7lopptq5gg

I’d really like to know if a better way to make the camera is available or if there is a mistake I overlooked, I also am unsure if I properly explained what the issue was, if it’s not clear I’d really appreciate being known about it as english isn’t my first language. Thank you !