docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Configuration Chooser

    Understand how to use the Configuration Chooser to configure your AR session.

    The Configuration Chooser is an overridable class which you can use to configure your AR Session. You can use the Configuration Chooser to enable better performance for your application.

    Introduction to configurations

    An AR session's Configuration refers to the setup for the AR session on a specific device. For example, the type of light estimation, or camera facing direction used by the Camera.

    As different platforms and devices have different hardware and software capabilities, the configuration of the device can affect the AR features that are available. Additionally, one device might restrict different subsets of its capabilities for simultaneous use depending on the configuration. Use the Configuration Chooser to determine the device configuration you want to use to maximise feature availability, or prioritize high-importance features.

    Note

    Your app can only choose one configuration at a time, but can switch between multiple different configurations at runtime.

    Understand available configurations on a target platform

    You can create an ARDebugMenu to understand the available configurations for a specific platform, and identify the active configuration. You can create a configured AR Debug Menu from the Unity Editor, as described in Debug AR scenes.

    The AR Debug Menu displays the available session configurations in the Configurations tab, as outlined in Session Configurations.

    How the default Configuration Chooser chooses a configuration

    The default Configuration chooser assigns equal weights to all requested features and selects the configuration that allows the highest number of features. This AR Session uses this configuration to maximise the feature availability on the target device.

    To prioritize a specific feature in your app, you can customize the Configuration Chooser to assign more weight to that feature. For example, if your app requires face tracking with the user-facing camera, assign more weight to face tracking and user-facing camera features.

    Create a custom Configuration Chooser

    You can create your own Configuration Chooser for greater control over your app's configuration.

    To create a custom Configuration Chooser assigned to your AR Session:

    1. Select your AR Session component from the Hierarchy window to view it in the Inspector. If you don't have an AR Session, add one as outlined in Add the AR Session component.
    2. In the Inspector, select Add Component to open the Component menu.
    3. Select New Script and name the script.
    4. In your new script file, implement the ConfigurationChooser class.

    Refer to the following section for a sample you can use to get started with creating a custom Configuration Chooser.

    Configuration Chooser sample

    The AR Foundation Samples app provide a sample scene that uses a custom Configuration Chooser. This sample includes a custom Configuration Chooser to choose between the user-facing and world-facing camera. This is useful if your project uses Face tracking functionality.

    To access this sample, visit ConfigurationChooser (GitHub).

    Additional resources

    • What's new in Unity's AR Foundation | Unite Now 2020
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)