Legacy Documentation: Version 5.0
Language: English
  • C#
  • JS

Script language

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

Removed in version 5.0.1p4
Property camera has been deprecated. Use GetComponent<Camera>() instead. (UnityUpgradable)

GameObject.camera

Switch to Manual
public var camera: Component;

Description

The Camera attached to this GameObject (Read Only). (null if there is none attached).

	var other : GameObject; 
	var cam = other.GetComponent.<Camera>();
	cam.fieldOfView = 45;