Setting Up Lightship ARDK
Download and Install Unity
Download Unity. We support Unity 2022 LTS (with 2022.3.37f1) 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
- Create a new Unity project with the 3D (Core) template.
- In your Unity project, open the Window top menu, then select Package Manager.
- From the plus menu on the Package Manager tab, select Add package from git URL....
- Enter
https://github.com/niantic-lightship/ardk-upm.git
.- If prompted, click Yes to activate the new Input System Package for ARFoundation 5.0. This may require a restart of the Unity Editor.
- 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
- Open the Lightship top menu, then select XR Plug-in Management.
- 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.
In Unity version 2022.3.10f1 or newer, you might see a benign error in the console at this point.
Configure the Build Platform
- Open the Build Settings window by selecting File > Build Settings.
- 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.
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
- Download and install Gradle 6.7.1 from the Gradle Releases page.
- Replace the default Gradle install in Unity:
-
In Unity, open Preferences > External Tools > Android.
-
Uncheck the box labeled Gradle installed with Unity (recommended), then replace the path with your local installation of Gradle 6.7.1.
tipIf you are building through the command line, you can customize the Gradle path by setting
AndroidExternalToolsSettings.gradlePath
in your Unity build script. -
Set your Build Target to Android.
-
iOS Player Settings:
- Other Settings > Identification > Signing Team ID - Enter your iOS app developer key from developer.apple.com.
- Other Settings > Camera Use Description - Write a description for your use case for AR (e.g. "Lightship ARDK").
- Other Settings > Target Minimum iOS Version - Set to 14.0 or higher.
- Other Settings > Architecture - Select ARM64.
Create a Free Lightship Account and Configure API Key
- Open the Lightship top menu, then select Settings to open the Lightship Settings menu. Click on Get API Key under Credentials.
- Log in to your Lightship account or create a new free account.
- Open the Projects page, then select an existing project or create a new one by clicking New Project.
- In your project's Overview, copy the API Key by clicking the copy icon next to it.
- 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:
- Create a new Basic scene:
- From the main menu, choose File > New Scene.
- Select Basic (Built-in) and click Create.
- Right-click on the Main Camera and select Delete.
- Add an ARSession and XROrigin to your new scene
- Select the new scene in the Hierarchy.
- From the main menu, select Game Object > XR > AR Session.
- Repeat to add an XR Origin (Mobile AR).
- Save the scene using File > Save.
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.