Help with camera (30867)

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.

Maybe post the script code that you do have, and we can help you fix any problems in it.

1 Answer

1

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;
  }
}

thanks, just what I needed