- Augmented Reality for Developers
- Jonathan Linowes Krystian Babilinski
- 200字
- 2025-04-04 18:11:44
Adding the AR Controller
Every scene requires an AR controller object with toolkit components used to drive the app. The AR controller manages initialization, setup, and features, such as the video stream projection from the phone.:
- In your Unity project, in the Hierarchy panel, select Create | Create Empty (or, in the Main Menu, GameObject | Create Empty).
- Then, over in the Inspector panel, rename it to ARController.
- Click Add Component, find Scripts in the list, and add the AR Controller component to this object.
This object will be the base of all the interactions with ARToolkit. A fully expanded view of this component is shown here:

Almost all of these options can be ignored for now and left at their default value.
Make note of the Video Options Layer setting (we're referring to the Layer parameter within the AR Controller (Script) Video Options, not the object's Layer at the top of the Inspector).
When you imported the package, it should have automatically added layers named AR background, AR background 2, and AR foreground.
- Click the Layer selection to make sure they're there, and add them, if necessary, to the layers list and to the AR Controller component Layer option:
