# AR Modules

This page describes how to use the AR modules of the [Realvirtual.io XR & Multiuser](https://doc.realvirtual.io/extensions/realvirtual.io-industrial-metaverse) extension in your realvirtual scene.

Make sure you have correctly set up your device as described in the [Setup Guide](https://doc.realvirtual.io/extensions/realvirtual.io-industrial-metaverse/setup-guide).

{% embed url="<https://youtube.com/shorts/JIZQmuc4O2Y?si=03T5CYb4Z-lRYxpn>" %}
Example application created with Meta Quest 3
{% endembed %}

## realvirtual-ar-player

The realvirtual-ar-player prefab enables AR development in your scene.

![](https://260262196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpYxFg97YnJX96UzNNTSd%2Fuploads%2Fgit-blob-80bb5f9cc378946624789fe20fd08cbe0f4a67b6%2FScreenshot%202024-03-06%20070926.png?alt=media)

Search for **realvirtual-vr-player** and simply drag the prefab into your hierarchy. This initializes the AR development environment in your scene.

* The **OVRPlayerController** manages device tracking and user Input detection. Please refer to the official documentaion of the [Meta XR SDK](https://developer.oculus.com/documentation/unity/unity-gs-overview/).\\
* The **PlayerUI** holds the main AR user interface enabling the user to trigger various functionalities.\
  The player can toggle the main user menu by pressing the **A** button on the right controller.\
  Besides the functionality described in [VR Modules](https://doc.realvirtual.io/extensions/realvirtual.io-industrial-metaverse/vr-modules), the main menu in AR has some additional features described below.\
  \ <img src="https://260262196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpYxFg97YnJX96UzNNTSd%2Fuploads%2Fgit-blob-c2dfa4cac0bcd858a3e988fd42bc6c1cb3d21866%2FScreenshot%202024-03-06%20071510.png?alt=media" alt="" data-size="original">\
  \
  \ <img src="https://260262196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpYxFg97YnJX96UzNNTSd%2Fuploads%2Fgit-blob-05ffdd640699607f59ac25c0d2c39d309d33401b%2Fmeshtoggle.png?alt=media" alt="" data-size="line">This button toggles the scene mesh. This is the mesh placeable objects can be placed on.\
  \ <img src="https://260262196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpYxFg97YnJX96UzNNTSd%2Fuploads%2Fgit-blob-abcddb2941f4bd717a56eb18d47e9ce8b802ad4a%2Fdepth.png?alt=media" alt="" data-size="line">This button toggles depth occlusion. In order to use depth occlusion a separate installation of the Meta Depth API for Unity is required. Please refer to the official [Installation Guide](https://developer.oculus.com/documentation/unity/unity-depthapi/). Once the Meta Depth API is installed navigate to File > Build Settings > Player Settings > Other Settings > Script Compilation, add the `META_DEPTH_API` compile switch and press Apply.\\

  <figure><img src="https://260262196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpYxFg97YnJX96UzNNTSd%2Fuploads%2Fgit-blob-2c1f1a86817c064f5404521d52a42fddfac94e0e%2FScreenshot%202024-03-06%20072537.png?alt=media" alt="" width="375"><figcaption><p>Adding compile switch for depth occlusion</p></figcaption></figure>
* The **Passthrough** object contains the OVR Passthrough Layer component required for enabling passthrough. Refer to the official [Meta XR SDK](https://developer.oculus.com/documentation/unity/unity-gs-overview/) for details.\\
* The **Placer** object controlls the behaviour of the placement and allows to adjust the parameters for the placement.\\
* The **TransformManager** persists the transforms of all the placeables in the scene between multiple runtime sessions. To disable this feature, disable the TransformManager game object.\\
* The AR game object contains the OVRSceneManager documented in the [Meta XR SDK](https://developer.oculus.com/documentation/unity/unity-gs-overview/) and the EnvironmentDepthOcclusion game object documented in the [Depth API for Unity](https://developer.oculus.com/documentation/unity/unity-depthapi/). Both objects control interactions with the real world environment.\\
* The **XR Environment** object initializes the scene setup for optimal use with VR or AR. It manages lighting and core environmental aspects such as ground and sky.
