Adding objects
We're now ready to add virtual objects to the scene. For this project, we want to augment the business card with a flying drone quadcopter.
In AR, when the camera recognizes a target, we want the associated objects to appear and augment the scene. This association is defined by making the virtual objects a child of the target in the Hierarchy
.
First, we'll remove the cube and then add the drone:
- If you added a cube under
ImageTarget
you can delete it now (right-clickDelete
).
Assuming you have the SimpleDrone.unitypackage
file provided with the file downloads for this book from the publisher, you can import it now in Unity.
- From main menu choose
Assets | Import Package | Custom Package
, locate theSimpleDrone
package file and selectImport.
This will create a folder in your Assets
with sub-folders for Animation, Materials, Mesh, and Prefabs, as shown in the following screenshot:
- In the
Prefab
folder, select theSimpleDrone
prefab and drag it into theHierarchy
, as a child ofImageTarget...