2 min read

I decided it was time to move onto the 2019 version of Unity.

I tried upgrading the project automatically and was immediately met with a compile error :

“The type or namespace name ‘SpatialTracking’ does not exist in the namespace ‘UnityEngine’ (are you missing an assembly reference?)”.

This in turn meant that the TrackedPoseDriver wasn’t being found.

In the errata for the 2019 release I saw that the TrackedPoseDriver has been moved to the XRLegacyInputHelpers package (although the new Unity input classes won’t be available until 2021 according to one of their devs!!!).

This caused me a few hours of confusion. I know a lot more about the way Unity managed packages now. Sigh.

In the IDE there is Windows->Package Manager.  In there you can ask Unity to install the XRLegacyInputHelpers package.  Great.  Did it solve anything? no. Same problem.

Next step:  Check your project’s Packages/manifest.json.  The correct assembly is referenced.

Next step: Monkey about with different versions of the package.  Try using searching for different assembly namespaces.  Pull apart the compiled .dll looking for clues… try different beta versions of Unity 2019.  Go around in circles… then try a completely new Project, import the package… and the “using” statement compiles just fine.  Wha?!?!?

At this point, I remembered my last post here.  Unity – Assemblies – Unit Testing – No Bueno.

If you unit test, you need to make explicit assembly references… but how and from where.  At this point I noticed (you learn something new every day) that in the Project pane of the IDE there is a Packages folder.

In there you’ll find the XR Legacy Input Handlers folder, and buried inside there (Runtime->TrackedPoseDriver) the UnityEngine.SpatialTracking assembly. Find the assembly where you have a problematic assembly, and add a reference to this SpatialTracking assembly and it’ll work.

I wish Unity did a better job of documenting the basics.  I hope this saves you some time!

Would you like to beta test EyeSkills* or just follow what we are doing?

1 Comment