Getting Started With ARDK
This document describes the basic steps for getting started with ARDK. You’ll set up your developer environment and create a Unity project that integrates with the ARDK.
Set Up Your Developer Environment
Make sure your development environment meets the development requirements as described in System Requirements. At a minimum you’ll need to install Unity and the development tools for either iOS or Android.
Note
When using Unity 2020 on M1 Macs, an ARDK patch is automatically applied when importing ARDK into your project that disables some ARDK functionality. For more details see “Developing on M1 Macs” in Development and Runtime Requirements of ARDK and Troubleshooting.
Download the ARDK
Download the ARDK using the following instructions:
ARDK Downloads - Downloads page for ARDK.
Generate an API Token
You’ll need an ARDK API token to use some ARDK features such as networking and depth estimation. To generate a new API key, navigate to the “Create a new license key” section of this page: Lightship Account Dashboard
Create or Open a Unity Project
Create a new 3D Unity project. In the project you can use the default sample scene or create a new one.
Add the ARDK Package
Import the ARDK into your project as a custom Unity package. See instructions here: Adding ARDK to your Unity project
Add an Authentication Asset
ARDK features, such as networking and depth estimation, are authenticated against your API token. The ARDK provides an ArdkAuthConfig asset that you use to set the API token used to make API calls. Add an ArdkAuthConfig by following the first 3 steps in Authentication.
Configure an AR-aware Camera
In most cases you’ll want to configure a scene camera that is connected to the ARDK. ARDK features need to synchronize real-world camera information from the mobile device with the Unity camera. To make this connection you can use the ARSceneCamera prefab that the ARDK provides, or add ARCameraPositionHelper and ARRenderingManager components to your existing scene camera. To add a ARSceneCamera prefab to your scene:
Delete any default scene cameras that you don’t need.
In the Project View, navigate to ARDK/Extensions/Prefabs.
Drag ARSceneCamera into your scene and set the position as desired.
For any other ARDK managers you add to the scene, make sure the “Camera” field of those managers (if any) is set to this camera.
Add ARSession for Awareness Features
For awareness features you’ll need to create an ARSession. An ARSession configures which AR properties you want to enable, provides access to the AR system’s current world state, and lets you subscribe to AR events. You can create an ARSession as part of your scene initialization, for example, in the Start()
method of a script attached to a game object in your scene. Alternatively, you can use various AR feature managers to configure an AR Session. For more details on creating ARSessions, see Creating an AR Experience.
Optional: Add the ARDK-Examples Package
The ARDK-Examples package provides several example scenes and prefabs that you might be able to use as a starting point. You can import this package via Assets > Import Package > Custom Package and select the ardk-examples-(version).unityproject file you want to use. Import this package after you’ve successfully imported the ARDK in your project.
Note
If you’ve imported the ARDK-Examples package into your Unity project, you may have an extra ArdkAuthConfig
asset under Assets/ARDKExamples/Resources/ARDK that you should delete.
Optional: Decide Which Unity Input System to Use
ARDK supports both the Unity Input Manager and the Unity Input System for capturing user input, so you can configure your Unity project to use the system you prefer. If you want to use the Unity Input System, you’ll need to follow Unity’s instructions to install the Input System package in your project. If you want to use the Unity Input Manager, you don’t need to install any additional packages and ARDK will work with your Unity project as-is.
Note
The ARDK-Examples package has not been updated to support the Unity Input System package. Avoid importing ARDK-Examples in projects that have the Unity Input System enabled, as this will cause build problems.
Next Steps
Congrats, you’re now able to develop AR experiences in Unity using the ARDK. Next, dig into some of the fundamental concepts of the ARDK, such as:
Building for iOS Learn how to take a Unity ARDK project and build and deploy an iOS app.
Building for Android Learn how to take a Unity ARDK project and build and deploy an Android app.
Using Managers Learn about how to use ARDK managers to configure and access ARDK features.
Subscribing to ARDK Events Understand how to subscribe to ARDK events.
Validate Device Requirements Learn how to check for AR device capabilities at run-time.
Shared AR Learn how to create a shared AR experience for multiple users.
Once you’re familiar with the ARDK fundamentals, try some of the tutorials, browse the rest of the ARDK User Manual to learn how to work with advanced ARDK awareness and networking features, and review the ARDK samples.
Onboard with Lightship Guides. Learn how to develop with the ARDK through in-depth walkthroughs and videos.
Also, check out additional ARDK video walkthroughs and tutorials available in the Lightship AR YouTube channel.
If you’re new to Unity, you might find the resources at Unity Learn helpful.