arfoundation-samples icon indicating copy to clipboard operation
arfoundation-samples copied to clipboard

[2019.1.0a12] missing reference to UnitySpatialTracking

Open iBicha opened this issue 7 years ago • 16 comments

Empty new project with 2019.1.0a12, then adding AR Foundation from package manager:

Library/PackageCache/[email protected]/Runtime/AR/ARSessionOrigin.cs(3,19): error CS0234: The type or namespace name 'SpatialTracking' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)

I'm guessing this because 2019 is missing the UnitySpatialTracking extension (which is found in 2018.3, where this error doesn't occur)

iBicha avatar Dec 27 '18 02:12 iBicha

This is because the TrackedPoseDriver has been moved to a package in 2019.1, and we will need a separate package version to support it (the same package cannot be used for both 2018.3 and 2019.1, since the package it was moved to requires 2019.1).

If you want to try the bleeding edge now, you'll need to add this package to your project's manifest.json:

"com.unity.xr.legacyinputhelpers": "1.0.0"

and also add a reference to UnityEngine.SpatialTracking to ARFoundation's asmdef.

tdmowrer avatar Dec 28 '18 00:12 tdmowrer

Will this be fixed for the next AR Foundation update?

This is happening in 2019.1.0a14, interestingly the manifest.json file already contains "com.unity.xr.legacyinputhelpers": "1.0.0"

malDuffin avatar Jan 17 '19 12:01 malDuffin

still present with 2019.1.0b7 and commit 32ada6a on Feb 2

jackpritz avatar Mar 11 '19 17:03 jackpritz

@tdmowrer packages through package manager are read-only by default and changes to them are "fixed" at next editor load. This project probably has to be updated to 19.1 (maybe leave behind a 18.3 branch for legacy support?)

jackpr-unity avatar Mar 11 '19 18:03 jackpr-unity

FYI - arfoundation package version 1.1.0-preview.6 works great with 2019.1.0b8.

jackpr-unity avatar Mar 25 '19 20:03 jackpr-unity

I think this is fixed now. Please reopen if it's not

iBicha avatar Apr 25 '19 17:04 iBicha

This issue exists in 2019.1.0f2. How to fix this? Thanks

julia1981 avatar Apr 29 '19 21:04 julia1981

@julia1981 Make sure you are on AR Foundation 1.1 not 1.0. Only 1.1 works with 2019.1.

tdmowrer avatar Apr 29 '19 22:04 tdmowrer

Thanks, did a update and it works

julia1981 avatar Apr 29 '19 22:04 julia1981

Can confirm that it's fixed in 1.1.0-preview.6, but the error is back in 1.5.0-preview.2. I tried installing com.unity.xr.legacyinputhelpers, but was unclear as to how to properly modify the assembly file to link them.

neogeek avatar May 16 '19 23:05 neogeek

Use ARFoundation 1.5 for Unity 2018.3/4 Use ARFoundation 2.1 for Unity 2019.1/2

The only difference between ARFoundation 1.5 and 2.1 are the versions of Unity with which they are compatible. Unfortunately, there is no way for us to specify a max version of Unity.

tdmowrer avatar May 16 '19 23:05 tdmowrer

Whoops, didn't even think of that. Thanks for the heads up!

neogeek avatar May 17 '19 00:05 neogeek

@tdmowrer If you create a unitypackage in Unity 2019.2.18f1 and load it in another project using Unity 2019.2.18f1, this still seems to be a problem; without adding "com.unity.xr.legacyinputhelpers": "2.0.2" to your manifest file, the AR Session Origin object is broken, as others have mentioned.

Also, the script reference missing shows up as a warning, not an error-- I believe this should be an error as a TrackedPose driver not working in AR is a pretty fundamental mishap. The fact that nothing in any of the PackageManager descriptions says what you mention about 1.5 vs 2.1 is an oversight at the least. Aggressively, the PackageManager should prompt you to install legacyinputhelpers.

gblikas avatar Jan 28 '20 19:01 gblikas

We no longer depend on the tracked pose driver. You can still use it if you want, but ARFoundation has its own ARPoseDriver which provides similar functionality designed specifically to eliminate the dependency on legacy input helpers.

If you replace your tracked pose driver with an AR pose driver, that should fix the problem.

tdmowrer avatar Jan 29 '20 15:01 tdmowrer

There is a way around this error in Unity 2019.1.7f, all you have to do is to install AR Foundation, remove it and reinstall AR Foundation, for some reason this worked for me.

Yo030 avatar May 16 '20 18:05 Yo030

@Yo030 Thank you, this unblocked me!

slashinsky avatar Sep 19 '20 23:09 slashinsky