docs.unity3d.com
    Show / Hide Table of Contents

    Getting started

    You can test your AR scenes using XR Simulation with no scene changes necessary.

    To run your app in a simulated environment:

    1. Enable XR Simulation:

      1. Go to Edit > Project Settings to open the Project Settings window.
      2. In the Project Settings window, select XR Plug-in Management.
      3. Under Plug-in Providers, enable XR Simulation.
    2. Select an XR Simulation environment:

      1. Go to Window > XR > AR Foundation > XR Environment to open the XR Environment view.
      2. Select a simulation environment using the Environment dropdown in the center of the XR Environment overlay. At first your project only contains one environment, but you can Install the sample environments to add more.

        XR Environment overlay

    3. Open an AR scene, then press the Play button to enter Play Mode and begin simulation.

    Note

    As with all AR scenes, your scene must contain both an AR Session and an XR Origin for AR to function properly. See Scene setup for more information.

    Install the sample environments

    AR Foundation includes a variety of sample XR Simulation environments that you can optionally install to test your app. The XR Simulation sample environments include various scenes including interior rooms in homes and workplaces as well as exterior city and park settings.

    To install the XR Simulation sample environments into your project:

    1. Go to Window > XR > AR Foundation > XR Environment to open the XR Environment view.
    2. Click on the Environment dropdown to display the list of environments in your project. A new project will only contain one environment, named "DefaultSimulationEnvironment".

      The Environment list of a new project only contains one environment.

    3. At the bottom of the list, click Install sample environments.

      The sample environments are provided in a standard Unity Asset package. When you click Install sample environments, Unity automatically downloads the package and opens the Import Unity Package window.

    4. Select the environment Assets that you want to add to your project.

    5. Click Import.

    AR Foundation installs the environments to your Assets folder under UnityXRContent/ARFoundation.

    Note

    If you have already installed the sample environments, you can re-import them following the same process as above. In this case, the environment list provides an Import simulation environments option rather than Install simulation environments.

    Navigation controls

    You can navigate around the XR Simulation environment in the Game view during Play Mode using the same controls as you would in the Scene view's Flythrough mode:

    • Click and hold the right mouse button.
    • Move the view around using the mouse, the WASD keys to move left/right/forward/backward, and the Q and E keys to move up and down.
    • Hold down Shift to move faster.

    Did you find this page useful? Please give it a rating:

    Thanks for rating this page!

    Report a problem on this page

    What kind of problem would you like to report?

    • This page needs code samples
    • Code samples do not work
    • Information is missing
    • Information is incorrect
    • Information is unclear or confusing
    • There is a spelling/grammar error on this page
    • Something else

    Thanks for letting us know! This page has been marked for review based on your feedback.

    If you have time, you can provide more information to help us fix the problem faster.

    Provide more information

    You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:

    You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:

    You've told us there is information missing from this page. Please tell us more about what's missing:

    You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:

    You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:

    You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:

    You've told us this page has a problem. Please tell us more about what's wrong:

    Thank you for helping to make the Unity documentation better!

    Your feedback has been submitted as a ticket for our documentation team to review.

    We are not able to reply to every ticket submitted.

    In This Article
    • Install the sample environments
    • Navigation controls
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023