microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6k stars 2.12k forks source link

Magic Leap Integration not working #8902

Closed AdrianDot closed 3 years ago

AdrianDot commented 3 years ago

Describe the bug

After following the steps from the "How to Configure Leap Motion (by Ultraleap) Hand Tracking in MRTK" Guide Unity shows two Error-Messages :

"Assets\Plugins\LeapMotion\Core\Scripts\LeapXRServiceProvider.cs(240,36): error CS0234: The type or namespace name 'SpatialTracking' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)"

and

"Assets\Plugins\LeapMotion\Core\Scripts\LeapXRServiceProvider.cs(241,45): error CS0234: The type or namespace name 'SpatialTracking' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)"

Steps to reproduce the behavior:

  1. Follow the already mentioned guide to setup a Leap Motion for Unity.
  2. Usually happens as soon as i import Leap Motion Unity Modules (Step 1.3 in the Guide from Github from the MRTK). But also occures, when i try to integrate the Leap Motion Unity Modules with MRTK (Step 2.1)

Your setup (please complete the following information)

and

Additional context

I tried importing ARFoundation and it solved the error-messages for a moment till i tried to hit the playbutton.

I checked the scirpts which cause the error messages and (as expected) they´re just do not register UnityEngine.SpatialTracking.

I am glad for any kind of help, Adrian

CDiaz-MS commented 3 years ago

Hi @AdrianDot which version of the Leap Motion Unity Modules are you using? Only 4.5.0 and 4.5.1 are currently supported.

You also might need to add the Oculus XR package to your project as Leap had this note in their 4.5.1 release:

Note for 2020.1 users: If you get errors related to "SpatialTracking" upon importing the Core module, you need to install the Oculus XR package, which adds the necessary XR dependency.

https://github.com/leapmotion/UnityModules/releases/tag/UM-4.5.1

AdrianDot commented 3 years ago

Oh wow, that was exactly what was wrong! When i downloaded the Leap Motion Unity Modules i was only offered the version 4.6.0. I had to reach out for the github releases to download the right version.

So, it definitely worked with Unity Version 2019.4.12f1 + MRTK 2.5.1 + Magic Leap Unity Modules 4.5.1.

Thanks alot @CDiaz-MS for your help! Its the first time posting an issue on github for me and you already made this a good experience.