Setup Vuforia with Unity
The Unity version I will use is the 2021.1.22
- Register on Vuforia developer webpage
- Download the Vuforia Unity package here
- Drag and drop the package into our project. If it asks for updating the package, click on Update
- Click RMB on hierarchy to create an AR Camera and remove the Main Camera
- Add an image target in the hierarchy
An image target is what the Camera will look for to enable the AR experience
If you want to change the image target:
Click on F to see the Image in the scene tab
Print the image in a paper sheet or from your mobile
Now that we have the image target, we want something to happen. For testing, we will use a sphere and place it above the image target. Also place it as the image child
The desired behavior will be that after starting, the sphere will dissapear, and when the image is seen in the camera (paper or in your mobile), the sphere will be seen
If you want, change the default observer event handler to Tracked
The AR experience uses a physical camera (in this case, the PC webcam) to identify the image target while in play mode
If you enter in Play mode right now (as I did), it won’t work, because you’ll need to get a license key
Add a Vuforia License Key:
- Go to Window/Vuforia configuration
- In inspector, click on Add License
- Click on Get development key. Give it a name and follow the instructions
It will give you a code
Paste the code
Play mode result:
Further info: Working with Vuforia Engine and Unity