# Scene Setup
This guide assumes pre-existing knowledge of AR Foundation and OpenXR. For a more detailed overview, please visit the official AR Foundation (opens new window) and OpenXR (opens new window) Unity documentations.
This is what a proposed sample scene hierarchy looks like in order to run the project with AR Foundation and XR Interaction Toolkit support:
# AR Foundation
To enable positional head tracking, the following objects are required in the scene:
- AR Session
- AR Session Origin
- AR Camera (Tag this as "MainCamera")
In order to create these game objects manually, right-click in the hierarchy panel and select XR > AR Session or XR >AR Session Origin.
# Passthrough (Only for MR devices)
Passthrough (opens new window) refers to the possibility to bring the physical environment as an image to VR devices. To activate, inside UI > Floating Panel, there is an Extend Content panel with the checkbox to enable or disable Passthrough. The panel will only be active for the user if the device is Passthrough compatible. This check is done at
Start() in the
MainMenuSampleController.cs script with
The checkbox on the UI panel calls the function
OnPassthroughToggle() in the
MainMenuSampleController, that will set the
PassthroughToggle in the
BaseRuntimeFeature, which will enable the user to see or hide the physical environment image. It can be also toggled with each primary button press on each controller ("X" and "A" buttons).
The session camera must have its Background alpha set to 0 in order to use and visualize Passthrough correctly on a Unity scene. There will be an automatic warning shown in the logs if Passthrough has been enabled and the session camera has wrong background settings.