Develop
Develop
Select your platform

Get Started with Passthrough

Updated: Dec 9, 2025
This topic describes the instructions to get started with passthrough.
If you're new to Unity development on Quest, check out the Hello World guide to create your first VR app.

Prerequisites

Before proceeding with this tutorial, complete the setup steps outlined in:

Configure your Unity project

To configure your Unity project for passthrough, set up the OVRCameraRig using the following steps:
  1. Create a new scene or select an existing scene from your project.
  2. Delete any existing Main Camera objects from the Hierarchy tab.
  3. From the Project tab, locate the OVRCameraRig using search, and then drag the prefab into the scene.
  4. On the Hierarchy tab, select OVRCameraRig.
  5. On the Inspector tab, under OVRManager, do the following:
    a. Under Quest Features > General tab, in the Passthrough Support list, select either Required or Supported to enable the build-time components for using passthrough.
    b. Under Insight Passthrough, select Enable Passthrough to initialize passthrough during app startup. (To initialize passthrough at a later time through a C# script, you can leave the checkbox unchecked and set OVRManager.isInsightPassthroughEnabled in your script.)
  6. Create a new empty GameObject in the scene and navigate to its inspector tab. Click Add Component, and then in Scripts, select OVR Passthrough Layer.
Recommendation
If you have a multi-scene MR project it is recommended to use the same OVRPassthroughLayer instance across all scenes. In other words, the GameObject with the **OVR Passthrough Layer** component should contain a script that calls DontDestroyOnLoad() on the GameObject and the access this same instance of the component accross all of your scenes and only disable it in full VR scenes.
Note
When using **OVR Passthrough Layer (Script)**, you also need to set the Skybox Material to None. To do this, go to Window > Rendering > Lighting, and then on the Environment tab, in the Skybox Material field, select None. This ensures that the passthrough is visible behind your virtual content.
To experiment more with passthrough, first do either the basic Passthrough Basic Tutorial or the Basic Passthrough Tutorial with Building Blocks. For more showcase projects for Meta Quest, see the repositories in the oculus-samples GitHub organization. The Unity-Discover and Unity-TheWorldBeyond projects both make use of passthrough.

Customize passthrough

Customize passthrough through styling and color mapping.

Enable based on system recommendation

In your app, you may want to show either a VR or passthrough background based on user choice. Our system already provides users with this choice in the home environment, and your app can leverage the user’s home environment preference. More generally, our system provides a recommendation for apps to default to MR or VR based on user preferences. This recommendation is available using OVRManager.IsPassthroughRecommended(). Example usage:
// Add this to any MonoBehavior
void Start()
{
   if (OVRManager.IsPassthroughRecommended())
   {
      passthroughLayer.enabled = true;

      // Set camera background to transparent
      OVRCameraRig ovrCameraRig = GameObject.Find("OVRCameraRig").GetComponent<OVRCameraRig>();
      var centerCamera = ovrCameraRig.centerEyeAnchor.GetComponent<Camera>();
      centerCamera.clearFlags = CameraClearFlags.SolidColor;
      centerCamera.backgroundColor = Color.clear;

      // Ensure your VR background elements are disabled
   }
   else
   {
      passthroughLayer.enabled = false;

      // Ensure your VR background elements are enabled
   }
}

Wait until passthrough is ready

Enabling passthrough is asynchronous. System resources (like cameras) can take a few hundred milliseconds to activate, during which time passthrough is not yet rendered by the system. This can lead to black flickers if your app expects passthrough to be visible immediately upon enabling, and the passthrough system wasn’t previously active. You can avoid that by using the passthroughLayerResumed event, which is emitted once the layer is fully initialized, and passthrough is visible.
You don’t need to worry about this at app startup, though. If the transition leading into your app was already showing passthrough (see Loading Screens), you can rely on passthrough being rendered immediately upon enabling. Just make sure that your OVRPassthroughLayer is enabled right from the start. In other words, you only need to consider this event if you enable passthrough while the app is already running.
Example usage:
[SerializeField] private OVRPassthroughLayer oVRPassthroughLayer;

private void Awake()
{
  oVRPassthroughLayer.passthroughLayerResumed.AddListener(OnPassthroughLayerResumed);
  // 1) We enable the passthrough layer to kick off its initialization process
  oVRPassthroughLayer.enabled = true;
}

private void OnDestroy()
{
  oVRPassthroughLayer.passthroughLayerResumed.RemoveListener(OnPassthroughLayerResumed);
}

// 2) OnPassthroughLayerResumed is called once the layer is fully initialized and passthrough is visible
private void OnPassthroughLayerResumed(OVRPassthroughLayer passthroughLayer)
{
  // 3) Do something here after the passthrough layer has resumed
}

Rapid passthrough app development

You can speed up app development significantly by avoiding the need to rebuild and deploy for every iteration. Consider the following options:
  • Passthrough over Link allows you to run your app directly in the Unity editor with a headset connected over Link.
  • Meta XR Simulator allows you to run your app in a simulator without the need for a headset.
Did you find this page helpful?