How do you zoom with an orthographic camera?

From looking at the documentation and other questions I do:

Camera.main.orthographicSize *= scaleFactor

but the view displayed does not change.

I’ve checked that Camera.main.orthographic is true.

Using Debug.Log I’ve verified that I’ve changed the value a lot, in the range from 1 to 1000 and still I see no change in how the game looks. If I run the game in the editor and change the Size in the Inspector, it doesn’t change how much is displayed either.

How do I get zoom to work in orthographic projection?


You i think that you need to make reference to the camera instead of getting it from the Camera class.
Here is working example on how to do this:

using UnityEngine;
using System.Collections;

public class Test : MonoBehaviour 
	Camera cam;

	public void Start()
		cam =;

	public void Update()
			cam.orthographicSize -= .1f;
			cam.orthographicSize += .1f;