I have a Camera In a square room, with the camera facing straight ahead I can use the arrow keys to rotate around and look at the different walls:
if (Input.GetKey (KeyCode.LeftArrow)) {
transform.Rotate (Vector3.up, -turnSpeed * Time.deltaTime);
}
if (Input.GetKey (KeyCode.RightArrow)) {
transform.Rotate (Vector3.up, turnSpeed * Time.deltaTime);
}
However I want the Camera to be looking down at an angle of 20 degrees. Setting 20 in the Z axis gets me the desired angle looking at the first wall, but as I rotate around, the camera ends up looking at the ceiling, instead of the back wall. How can I fix this? Is there a way to set the 20,0,0 rotation as the zero or something? or use a parent somehow?