user687319
user687319

Reputation: 13

Unity error CS0246 (namespace could not be found)

I'm trying to follow this this tutorial:

https://www.freecodecamp.org/news/how-to-create-your-first-hololens-app-with-unity-1afa364843d4/

After I created a script to try and rotate the cube, I got an error in Unity:

Assets\InteractiveCube.cs(4,7): error CS0246: The type or namespace name 'HoloToolkit' could not be found (are you missing a using directive or an assembly reference?)

This is the line of code it breaks on:

using HoloToolkit.Unity.InputModule;

I have the latest version of the Mixed Reality Toolkit downloaded. I am using Unity 2018.4.8f1 and Visual Studio.

If you have encountered this problem and know how to solve it, please let me know! If you know of an alternative to accomplish the same task, I would love to know as well!

Upvotes: 1

Views: 1959

Answers (1)

Hernando - MSFT
Hernando - MSFT

Reputation: 2900

After Holotoolkit was updated to MRTKv2, the namespace has changed and MRTKv2 is NOT compatible with HoloToolkit. Now the APIs you need to call are in the namespace Microsoft.MixedReality.Toolkit. You can search for the API that meets your needs in this link: https://microsoft.github.io/MixedRealityToolkit-Unity/api/Microsoft.MixedReality.Toolkit.html.

If you insist on using Holotoolkit, please click on this link to download the previous version: https://github.com/microsoft/MixedRealityToolkit-Unity/releases/tag/2017.4.3.0-Refresh

Also, for the latest MRTK, it is recommended that you read the lastest Microsoft documentation: https://learn.microsoft.com/en-us/windows/mixed-reality/mrlearning-base-ch1 & https://microsoft.github.io/MixedRealityToolkit-Unity/Documentation/GettingStartedWithTheMRTK.html

Upvotes: 2

Related Questions