Camera.orthographic Manual     Reference     Scripting  
Scripting > Runtime Classes > Camera
Camera.orthographic

var orthographic : boolean

Description

Is the camera orthographic (true) or perspective (false)?

When ortho is true, camera's viewing volume is defined by orthographicSize.
When orthographic is false, camera's viewing volume is defined by fieldOfView. See Also: camera component

JavaScript
// Set the camera to be orthograpghic

camera.orthographic = true;

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
void Example() {
camera.orthographic = true;
}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

def Example():
camera.orthographic = true

Specifically for the main camera:
JavaScript
// Set the main camera to be orthographic

Camera.main.orthographic = true;

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
void Example() {
Camera.main.orthographic = true;
}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

def Example():
Camera.main.orthographic = true