Version: 5.4 beta (switch to 5.3)
LanguageEnglish
  • C#
  • JS

Script language

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

Camera.stereoTargetEye

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual
public var stereoTargetEye: StereoTargetEyeMask;
public StereoTargetEyeMask stereoTargetEye;

Description

When Virtual Reality is enabled, the stereoTargetEye value determines which eyes of the Head Mounted Display (HMD) this camera renders to. The default is to render both eyes.

The values passed to stereoTargetEye are found in the StereoTargetEyeMask enum. Every camera will render to the Main Game Window by default. If you do not want to see the content from this camera in the Main Game Window, use a camera with a higher depth value than this camera, or set the Camera's showDeviceView value to false.

See Also: StereoTargetEyeMask.

GetComponent<Camera>().stereoTargetEye = StereoTargetEyeMask.Both;
this.GetComponent<Camera>().stereoTargetEye = StereoTargetEyeMask.Both;