How do I create an AR marker for Vuforia / Unity?
This is an awfully basic question I know (!), But how do I create and import an AR marker in Unity? I know I intend to do this through the Vuforia Marker Manager page. I created the target database and I loaded the database, but how do I get the marker to display in Unity?
See also: What is a target database? Is this a different name for "marker"?
source to share
To answer your question, yes, your marker is your goal.
So what you need to do:
-
Go to License Manager .
Add a License Key
select None as your licensing plan. -
Now go to Target Manager . Create
Database
and add a license for this from the dropdown list. -
Add a target and select on your computer the image you want to be a marker and upload it.
-
After the Target status changes to active, you can click Load Database and make sure you select UnityEditor. This loads a
.unitypackage
-
Now in Unity go to
Assets
>Import New Assets...
and find the.unitypackage
one you downloaded
This is how you import your database.
If you do not import the package Unity Vuforia, then you just need to download it from the section Downloads and import it through
Assets
>Import Package
>Custom Package
-
Now ideal for working with AR, you should use
AR Camera
that in your panelAssets
underQualcomm Augmented Reality
>Prefabs
. DragARCamera
to your stage. -
With the help
AR Camera
selected inHierarchy
, go to the tabInspector
. You will seeData Set Load Behavior
. According to this, you MUST see the name.unitypakage
you imported ealier. Check the name in the same way asActive
. -
Now in
Qualcomm Augmented Reality
>Prefabs
you will also seeImage Target
. Drag it to the screen. -
With
ImageTarget
chosen inHierarchy
, look atInspector
, should beImage Target Behaviour
Fill in as follows
Type: Predefined
Data Set: <Name of imported .unitypackage>
Image Target: <Name of Picture uploaded into the Database>
Now you can bypass Image Target as per your application requirements.
NOTE. In the license manager, click on the license name and you will see an alphanumeric code. Copy this code and inside Inspector
AR Camera
, underneathQCAR Behaviour>App License Key
paste the code. This needs to be done in order for your application to work on your device.
Hope this helps you. Please feel free to ask me.
source to share
There are a few things you need to do before you can make them work.
First, I noticed that you mentioned creating a target database on the Vuforia website, but did you really add any markers to it? Markers are the actual AR images that will be scanned. The target database is a collection of markers that can be used concurrently in your Unity application.
Once you upload your markers, they should be rated 2-4 stars as shown in the picture
After loading the database into UnityPackage, you need to import it into Unity along with the Vuforia Unity SDK .
If you still can't get an example of a scene running in Unity, you can download the sample scene from the previous link.
source to share