Unity Move, Zoom and Rotate Camera

Unity Move, Zoom and Rotate Camera

Move: It is same as moving character. Just use keyboard buttons and move camera with a float speed variable.
private float speed = 2.0f;
void Update () {
 
  if (Input.GetKey(KeyCode.RightArrow)){
   transform.position += Vector3.right * speed * Time.deltaTime;
  }
  if (Input.GetKey(KeyCode.LeftArrow)){
   transform.position += Vector3.left * speed * Time.deltaTime;
  }
  if (Input.GetKey(KeyCode.UpArrow)){
   transform.position += Vector3.forward * speed * Time.deltaTime;
  }
  if (Input.GetKey(KeyCode.DownArrow)){
   transform.position += Vector3.back * speed * Time.deltaTime;
  }
 }

Zoom: To zoom with scroll wheel, we need scroll wheel input to zoom in or zoom out.
private float zoomSpeed = 2.0f;
 
 void Update () {
 
  float scroll = Input.GetAxis("Mouse ScrollWheel");
  transform.Translate(0, scroll * zoomSpeed, scroll * zoomSpeed, Space.World);
 }

Rotate: I will give an example with mouse button pressed but you can change it with any button or none. Just change or delete if(Input.GetMouseButton(0)).

We need maximum and minimum values for the axes and assign sensitivities.
public float minX = -360.0f;
 public float maxX = 360.0f;
 
 public float minY = -45.0f;
 public float maxY = 45.0f;
 
 public float sensX = 100.0f;
 public float sensY = 100.0f;
 
 float rotationY = 0.0f;
 float rotationX = 0.0f;
 
 void Update () {
 
  if (Input.GetMouseButton (0)) {
   rotationX += Input.GetAxis ("Mouse X") * sensX * Time.deltaTime;
   rotationY += Input.GetAxis ("Mouse Y") * sensY * Time.deltaTime;
   rotationY = Mathf.Clamp (rotationY, minY, maxY);
   transform.localEulerAngles = new Vector3 (-rotationY, rotationX, 0);
  }
 }

Unity Move, Zoom and Rotate Camera