qian256 / HoloLensARToolKit

Marker tracking using the front-facing camera of HoloLens (both 1 and 2) and Unity, with a wrapper of ARToolKit built for UWP (Windows Universal Platform)
GNU Lesser General Public License v3.0
349 stars 92 forks source link

Has anyone succeeded in unity 2020? #67

Open shoukailiang opened 2 years ago

shoukailiang commented 2 years ago

Has anyone succeeded in unity 2020?

USTBVEO commented 2 years ago

I tried to build on Hololens but it turned to the error : Assets\ARToolKitUWP\Scripts\ARUWPVideo.cs(723,20): error CS0103: The name 'WorldManager' does not exist in the current context image I searched and find that 'WorldManager' doesn't exist in Unity 2020.3. image

petergu684 commented 2 years ago

In Unity 2020 (and all other versions using XRSDK), replace the line with following:

 WorldOriginPtr = UnityEngine.XR.WindowsMR.WindowsMREnvironment.OriginSpatialCoordinateSystem;

PS: It won't work in Unity 2021.2 or later where OpenXR is the only supported pipeline.

USTBVEO commented 2 years ago

In Unity 2020 (and all other versions using XRSDK), replace the line with following:

 WorldOriginPtr = UnityEngine.XR.WindowsMR.WindowsMREnvironment.OriginSpatialCoordinateSystem;

PS: It won't work in Unity 2021.2 or later where OpenXR is the only supported pipeline.

Thanks and I did that where I found that the hologram moved as I turned around my head. The hologram was not set to a fixed position. How can I tackle this problem? Thanks a lot!