Use AR Camera to place a camera in your project to view your scene. Use the camera properties to customize the view, whether it be in space or on a surface.
Download the following assets file to create an effect where UFOs float in the air:
Add an AR Camera
Add an AR camera by going to the Hierarchy panel and clicking the Add button [+] > Scene Object > Camera.
Then select the Camera object and in the Inspector panel, click + Add component > AR Capability > Device Tracker. Learn more about camera properties.
When creating an AR camera, remember to delete the default Camera if you don’t need it.
Configure Device Tracker of the AR Camera
Select the AR camera. Navigate to the Device Tracker component in the Inspector panel. Set the Tracking Mode of the Device Tracker component to World. This will ensure that all the objects that are rendered by the AR camera will be tracked in the world. You will be able to hold the device and move around freely.
Device Tracker Properties
The Device Tracker component obtains the rotation and position of your phone. It can be used to create AR environment experiences like placing a 3D character/object on the ground or adding a drone to make it fly in the air.
- World: Support 6 DoF (degrees of freedom) in space, which means it will capture the position and orientation of the phone in world space. Use this mode when you want to position the object at a specific location in the world.
- Orientation: Support 3 DoF (degrees of freedom) in space, which means it will detect orientation but not position in world space for the device. The objects will keep the same relative position as the camera, so you can’t walk close to or far from the objects you placed.
Place Your 3D Object in the World Space
Import 3D Assets
Download the UFO assets and import them into Effect House to get started.
Add Imported 3D Assets to the Scene
Drag the UFO model to the Hierarchy panel.
Set up the Transform of the Object
Let’s set up the scale of the UFO to match the real-world unit. Create an empty scene object by clicking the Add button [+] > Empty Mesh in the Hierarchy panel. Let’s rename the Empty Mesh object to AR container. Set up the scale of AR container to (0.05, 0.05, 0.05).
Then drag the UFO model underneath AR camera and set the scale of the UFO to (1, 1, 1).
Since the scale ratio between the 3D scene of Effect House and the real world is 20:1, we create the AR container with the scale of 0.05 to match the unit in the real world.
Set up the position and rotation of the object as you want.
Preview Your AR Effect on TikTok
To better preview AR effects, click on the Preview in TikTok button, and scan the QR code to test your effect.