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.
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.
Decide Which ARDK Features You Want
By this point your Unity project is configured to use ARDK awareness and multiplayer interfaces. See the next sections for basic tips on adding these features to your project.
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.
Add Networking Features
ARDK provides both low-level and high-level networking interfaces. See “When to use the HLAPI vs MultipeerNetworking” in Using the High-Level Networking API to understand which one you’ll want to use.
For low-level networking you’ll use the MultipeerNetworking interface and other low-level networking interfaces. An easy way to configure and add MultipeerNetworking to your scene is to use the ARNetworkingSceneManager prefab that comes with the ARDK. See the Pong Demo Tutorial and Pong scene in the ARDK-Examples sample for an example of how to use low-level networking.
For high-level networking you’ll use the HlapiSession interface and other HLAPI interfaces. See the Pong HLAPI Tutorial and PongHLAPI scene in the ARDK-Examples sample for an example of how to use HLAPI networking.
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.
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.
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.
Creating Shared AR Experiences Learn how to create a shared AR experience for multiple users.
Networking: Creating a Multiplayer Experience Get an overview of ARDK networking features.
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.
Also, check out the 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 resources helpful.