Help with camera

Hi all, I need help to move the camera to 45 degrees with the left mouse button and when the button is released, the camera returns to its initial state, thank you if someone helps me do it.

You need to be alot more specific about what you want to to do but im guessing you want something like this you’ll likely need to tweek it abit though.

function Update(){
  if(Input.GetMouseButtonDown(0)){
    Camera.main.transform.rotation.eulerAngles.z=45;
  }

  if(Input.GetMouseButtonUp(0)){
    Camera.main.transform.rotation.eulerAngles.z=0;
  }
}