Legacy Documentation: Version 5.5
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Camera.allCameras

Switch to Manual
public static Camera[] allCameras;

Description

Returns all enabled cameras in the scene.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public int count = Camera.allCameras.Length; void Example() { print("We've got " + count + " cameras"); } }