Table of Contents

Configure AR scene

This article takes image tracking as an example to introduce how to configure the simplest AR scene.

Before you begin

  • Follow the instructions in Enable EasyAR to import the EasyAR Sense Unity plugin and fill in the license key.
Note

If your project uses URP (Universal Render Pipeline), additional URP configuration is required.

Add AR session

In the Hierarchy view, right-click on a blank area, and create a session for image tracking via the menu EasyAR Sense > Image Tracking > AR Session (Image Tracking Preset).

PresetImageTracking

Configure the camera

Select Main Camera, and set the following parameters in the Inspector.

  • Set Clear Flags to Solid Color.
  • Set Background to black.
  • Set Clipping Planes Near to 0.1 (meters) and Far to 1000 (meters).

mainCameraSetting

Add target

In the Hierarchy view, right-click on a blank area, and add an Image Target through the menu EasyAR Sense > Image Tracking > Target : Image Target. By default, it will be displayed as a question mark icon.

createimagetarget

Select the image to be tracked, configure the following parameters, and click the Apply button to apply the settings:

  • Set Texture Type to Editor GUI and Legacy GUI.
  • Enable Read/Write in Advanced.
  • Set Format to RGB 24 bit.

createimagetarget

Configure the ImageTargetController:

  • Set Source Type to Texture 2D.
  • Set Texture to the configured image.
  • Set Name to namecard.
  • Set Scale to 0.09 (indicating 0.09 meters).
  • Set Tracker to ImageTrackerFrameFilter under ARSession.

addimagetargetcontroler

Tip

When the Source Type is different, some configuration content will vary.

Add 3D content that follows the target

The 3D content added under the Image Target node remains fixed relative to the position of the image, meaning the virtual content follows and displays as the image moves.

In the Hierarchy view, select Image Target, then add a Cube via the menu 3D Object > Cube.

add3D-1

Select the Cube you just added and configure its properties:

  • Set the Scale of Transform to {0.5, 0.3, 0.3}.
  • Set the z value of the Position in Transform to -0.15 (to align the bottom face of the Cube with the recognition image).

add3D-2

At this point, the simplest AR scene configuration is complete. Run the scene and align it with the image to see the Cube appear above the image.

Next steps

  • During operation, you will notice yellow text displayed on the screen. You can read Diagnostic Information in the Scene to understand the meaning of these messages and common configuration methods.