AR Fundamentals
Image Detection

To create this template, you should have already downloaded and installed the Lightship ARDK and the Lightship Hub packages.

What Does It Do?

The Image Detection template detects an image and lets you spawn a prefab on top of it. You can customize it by choosing the image you want to detect on the phone, and replace the prefab to instantiate when this is triggered.

Create the Template

Open the Welcome to Lightship Templates page in the Hub and select the Image Detection template under AR Fundamentals.

You can also access it from the menu: Lightship > Lightship Hub > Templates > AR Fundamentals > Image Detection.

This will create a series of objects and set up the current scene with all the scripts and components needed to start working. Once you reach this step, you should have a fully working scene that’s ready to be exported.

Test It in the Editor

The easiest way to test the template in Unity Editor is to select a mock scene environment. Go to the Lightship Menu > ARDK > Virtual Studio, then select Mock. For this template, select the InteriorScene environment.

Press Play in Unity to run the template scene.

Customize Your Scene

Change the Model Prefab

To add your own content to the template, exit play mode and replace the [REPLACE ME] object with your own 3D model.

Your object will be instantiated on top of the detected image from now on.

Change the Image to Detect on the Device

To use your own image, upload your .JPG file to the Unity project StreamingAssets folder by dragging it into it.

Select the ARController, and in the Inspector panel, write the name of your image file (do not include the extension .jpg, just the name as it is shown in the StreamingAssets folder).

When needed, build your app to test against the image on your phone camera.

Ready to build?