Pan Orthographic camera in 3D

How do I pan a camera with touch(mouse drag also works), which is rotated on the X by 30 and on the Y by 45 degrees. I want the camera to move like in Clash of Clans or similar strategy games.

Here’s what I have right now, but it doesn’t work properly:

public class CameraMovement : MonoBehaviour {

	public Transform camDrone;
	public Camera mainCam;
	public float camSpeed;
	
	// Update is called once per frame
	void Update () {
		if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Moved) {
			Vector2 touchPos = Input.GetTouch (0).deltaPosition;
			Vector3 camPos = new Vector3 (-touchPos.x, 10f, -touchPos.y);
			camDrone.Translate (camPos * camSpeed * Time.deltaTime);
		}
	}
}

I think that your code nearly works. Just specify Space.World as the second argument of Translate method. If you left it unset, the local basis of object is used, and as your camera is rotated it will not work as you expect.

I think, rather than translate, you will want to use lerp or Vector3. Lerp or whatever it’s called and create way points as necessary. Just check out lerp the documentation.

I think you should rewrte it and as your camera is rotated it will not work as you expect.
I think you should rewrte it and as your camera is rotated it will not work as you expect.

Simple solution would be to an empty game object and add camera to it as a child.
When you rotate/move that game object, camera will move with it keeping intended orientation.