Hi Anthony,
Thank you for your response. I basically want to update the script so that the pan movement in aligned to the camera X/Y rather than aligning it to the surface you are clicking on. I would like to keep all of the other functionality so this is the only part of the script I have changed. I am still getting some strange behaviour with the zoom, it will fly off to extreme distances and the rotation will sometimes move the camera to the wrong location.
I think I understand your logic correctly, there's quite a lot of abstraction so it's hard to follow, but I believe you are using the offset value as the location of the pivot point for the orbit controls then the distance is the distance from that point to the camera? You then calculate the angle from that pivot point?
Many thanks