Skip to main content

Setting Up Lightship ARDK

Download and Install Unity

Download Unity. We support Unity 2022 LTS (with 2022.3.24f1) and 2021 LTS (with 2021.3.37f1).

Unity 2022 LTS users will need to manually upgrade Visual Scripting from 1.9.0 to 1.9.1 or higher via the Package Manager to avoid a SessionStateChangedEventUnit error.

Install the Latest ARDK Packages

  1. Create a new Unity project with the 3D (Core) template.
  2. In your Unity project, open the Window top menu, then select Package Manager.
  3. From the plus menu on the Package Manager tab, select Add package from git URL....

    Package Manager menu

  4. Enter https://github.com/niantic-lightship/ardk-upm.git.
    1. If prompted, click Yes to activate the new Input System Package for ARFoundation 5.0. This may require a restart of the Unity Editor.
  5. To add the SharedAR package, repeat these steps using the following URL instead: https://github.com/niantic-lightship/sharedar-upm.git.

To use a specific ARDK version, download its .tgz from our releases page (ardk-upm, sharedar-upm). Then, follow the installation instructions above and select "Add package from tarball" instead of the Git URL.

Configure your Mobile Platform

  1. Open the Lightship top menu, then select XR Plug-in Management.
  2. In the XR Plug-in Management menu, select the platform you would like to develop for, then check the box labeled Niantic Lightship SDK.
    • For Android, select Niantic Lightship SDK + Google ARCore.
    • For iOS, select Niantic Lightship SDK + Apple ARKit.
caution

In Unity version 2022.3.10f1 or above, you might see a benign error in the console at this point.

Configure the Build Platform

  1. Open the Build Settings window by selecting File > Build Settings.
  2. Select iOS or Android, then click Switch Platform. After the progress bar finishes, click Player Settings.

Android Player Settings:

  • Other Settings > Rendering - Uncheck Auto Graphics API. If Vulkan appears in the Graphics API list, remove it.
  • Other Settings > Identification - Set the Minimum API Level to Android 7.0 'Nougat' (API Level 24) or higher.
  • Other Settings > Configuration - Set the Scripting Backend to IL2CPP, then enable both ARMv7 and ARM64.
Attention

If you are using Unity 2022.3.15f1 or older, building to Android requires a custom Gradle installation.

Click here to reveal the Gradle installation instructions
  1. Download and install Gradle 6.7.1 from the Gradle Releases page.

  2. Replace the default Gradle install in Unity:

    1. In Unity, open Preferences > External Tools > Android.

    2. Uncheck the box labeled Gradle installed with Unity (recommended), then replace the path with your local installation of Gradle 6.7.1.

      Custom Gradle Build Settings
      tip

      If you are building through the command line, you can customize the Gradle path by setting AndroidExternalToolsSettings.gradlePath in your Unity build script.

    3. Set your Build Target to Android.

iOS Player Settings:

  1. Other Settings > Identification > Signing Team ID - Enter your iOS app developer key from developer.apple.com.
  2. Other Settings > Camera Use Description - Write a description for your use case for AR (e.g. "Lightship ARDK").
  3. Other Settings > Target Minimum iOS Version - Set to 14.0 or higher.
  4. Other Settings > Architecture - Select ARM64.

Create a Free Lightship Account and Configure API Key

  1. Open the Lightship top menu, then select Settings to open the Lightship Settings menu. Click on Get API Key under Credentials.
  2. Log in to your Lightship account or create a new free account.
  3. Open the Projects page, then select an existing project or create a new one by clicking New Project.
  4. In your project's Overview, copy the API Key by clicking the copy icon next to it.
  5. Return to the Lightship Settings window in Unity and paste your API Key into the API Key field.

Next Steps

Setting Up a Basic AR Scene

To get started creating your own AR project, begin by creating an empty AR scene:

  1. Create a new Basic scene:
    1. From the main menu, choose File > New Scene.
    2. Select Basic (Built-in) and click Create.
  2. Right-click on the Main Camera and select Delete.
  3. Add an ARSession and XROrigin to your new scene
    1. Select the new scene in the Hierarchy.
    2. From the main menu, select Game Object > XR > AR Session.
    3. Repeat to add an XR Origin (Mobile AR).
  4. Save the scene using File > Save.
tip

If you choose Save As Scene Template you can select this scene in the New Scene dialog next time.

Further Reading

From here, proceed to the Sample Projects page to try out the features or to the How-To page to experiment with a guided tutorial. If you instead have a previous ARDK project you would like to convert to ARDK 3, see our Migration Guide.