I'm trying just to test Vuforia Sample on Unity for Hololens 2 but after trying it several times I didn't manage to do it.
I have followings guides from Vuforia as reference (specially the last one), and I followed them STEP BY STEP without success:
- Getting Started with Vuforia Engine in Unity
- Vuforia Play Mode in Unity
- Working with the HoloLens Sample in Unity
I use Unity 2021.3.9f1, Vuforia 10.10.2 and Vuforia Hololens 2 Sample (also 10.10.2).
As it's explained on the guides, I carry out following steps:
- New 3D project in Unity.
- Switch platform to Hololens 2 (ARM 64-bit, Min. platform version 10.0.18362.0).
- Add features with Mixed Reality Features (Fundation and XR).
- Set project MRTK and XR options.
- Import Vuforia Hololens 2 Sample assets using Package Manager.
After all these steps, I get some errors and the image target on VuforiaContent doesn't find the reference image.
The error I get is: "Found an existing event system in your scene. The Mixed Reality Toolkit requires only one, and must be found on the main camera.
If I close the project and open it again, I get following errors (check screenshot attached):
- Warning: - Found and existing event system in your scene. The Mixed Reality Toolkit requires only one, and must be found on the main camera.
- Error: For mixed Reality Toolkit input work properly, please remove your other input module(s) and add a MixedRealityInputModule to your main camera.
- Warning: Setting the manager scene MixedRealityToolkit instance to the active instance
- Error: ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection
And, what strikes me the most is that Vuforia Assets seems not to be imported (camera doesn't have VuforiaBehaviour component and there is no Vuforia menu on Game Objects), but if I try to import Vuforia Engine by opening Vuforia unitypackage file, I get a popup indicating that it is already imported.
It says: Nothing to import! All assets from this package are already in your project.
Because the same reason, on the scripts of Vuforia Objects, there is a warning that says the script can not be loaded.
I've tried all this several times, different order steps, trying different options... without success.
After all this, my questions are: what I could be doing wrong? Has anyone been able to run this example with Unity 2021?
Thanks in advance!
EDIT FOR ADDITIONAL INFORMATION:
I tried to create a basic project just adding hololens features, vuforia package, and one image target and it worked.
It's just a very simple example using the "Astronaut card" from the default database, and a cube that appears and disappears over it when the image is found and lost.
So it means that Vuforia package can be properly imported and can work without problem with my configuration (unity version, hololens packages...)