Skip to main content

AR Camera

Augmented reality (AR) effects with virtual objects that appear to exist in real space require the use of an AR camera. An AR camera is not a feature built into Effect House; rather, it is a Camera object with a Device Tracker component added to it. You can use an AR camera in conjunction with a 3D object to interact with the object in a real-world setting.

Add an AR Camera

note

An AR camera is required to interact with a 3D object in a real-world setting.

An AR camera is composed of a Camera object with a Device Tracker component.

Add a Camera component by going to the Hierarchy panel and clicking the Add button [+] > Scene Object > Camera.

Then select the Camera object in the Hierarchy panel and in the Inspector panel, click + Add component, go to AR Capability, and select Device Tracker.

Now you have an AR camera!

tip

By default, a Camera object is available in the Hierarchy panel when you create a project. If you do not need the default camera, you can delete it by right-clicking it and selecting Delete.

Configure the Device Tracker of an AR Camera

The Device Tracker component obtains the rotation and position of your device. Device Tracker can be used to create experiences in an AR environment. For example, you can place a 3D object or character on the ground or have drones fly in the air.

Device Tracker Properties

Tracking Mode

  • World: Supports 6 degrees of freedom in space, which captures the position and orientation of the device in the real-world space. Use this mode when you want to position the object at a specific location in the world.
  • Orientation: Supports 3 degrees of freedom in space, which detects only the orientation, and not position, of the device in the real-world space.
  • Surface: The object will be on the tracking plane and the plane will not change the position of the object regardless of the user's movement or selection To configure the Device Tracker for AR, Select the Camera object in the Hierarchy panel and locate the Device Tracker component in the Inspector panel.

From the Tracking Mode dropdown, choose World. This ensures that all objects rendered by the AR camera are tracked in the world setting. You can now hold your device and move around freely.

tip

An object keeps the same relative position as the camera, so you should avoid walking too close to, or too far from, the placed object.

device tracker

Demo Effect: Place a 3D Object in the Real World

Create an effect where UFOs float in the air!

ufo demo

Import 3D Assets

Start by downloading the following assets and importing them into Effect House:

UFO-assets.zip

Add Imported Assets to the Scene

Drag the imported UFO model to the Hierarchy panel.

Set the Transform of the Object

note

Starting in Effect House v2.1.0, the default measurement of scale changed from meters to centimeters. This unit change better aligns the scale in the 3D scene with the scale in the preview. Previously, a 3D object was scaled down by 100x. Now you can easily adjust the object’s position and rotation to your liking!

Set the scale of the UFO to match the real-world unit. Create an empty scene object by clicking the Add button [+], going to Scene, and selecting Scene Object in the Hierarchy panel.

You can rename the empty scene object by right-clicking the Scene Object and selecting Rename. Enter a new name, for instance, "AR Container".

Select the empty scene object in the Hierarchy panel and locate its Transform component in the Inspector panel. Change the X, Y, and Z values of Scale to 0.05, 0.05, and 0.05, respectively.

Then drag the UFO model below the empty scene object and select the UFO model. Locate its Transform component in the Inspector panel, and change the X, Y, and Z values of Scale to 1, 1, and 1, respectively.

Preview an AR Effect

To better preview an AR effect, click the Preview in TikTok button, and scan the QR code to test your effect.

preview AR effect