LanguageEnglish
  • C#
  • JS

Script language

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

This version of Unity is unsupported.

Camera.fieldOfView

Switch to Manual
public var fieldOfView: float;

Description

The field of view of the camera in degrees.

This is the vertical field of view; horizontal Field of view varies depending on the viewport's aspect ratio, for more information see VerticalToHorizontalFieldOfView. Field of view is ignored when camera is orthographic (see orthographic).

Some VR SDKs have fixed field of view values that are used for VR cameras. When VR is enabled with those SDKs, this property will always return the value from the SDK. You will see a warning logged if you attempt to set the property and the value will be ignored.

If you make changes to the projectionMatrix, the camera no longer updates its rendering based on its fieldOfView. This lasts until you call ResetProjectionMatrix.

If you make changes to the projectionMatrix, the camera no longer updates its rendering based on its fieldOfView. This lasts until you call ResetProjectionMatrix.

See Also: camera component.

no example available in JavaScript