How do I use the new 'Disable Tracking Mask'?

If I set this flag to anything but ‘Nothing’, I get an exception when a Game Object is created with the a layer I’ve set to be disabled. The stack trace looks like this:

KeyNotFoundException: The given key '2112190:0' was not present in the dictionary.
System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <f646c7a159d243a7909d5204af0f0c56>:0)
Unity.PolySpatial.Internals.UnitySceneGraph.FindBackingGameObjectForId (Unity.PolySpatial.Internals.PolySpatialInstanceID simIid) (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Platforms/Unity/UnitySceneGraph.cs:245)
Unity.PolySpatial.Internals.UnitySceneGraph.UpdateEntityParent (Unity.PolySpatial.Internals.PolySpatialInstanceID id, Unity.PolySpatial.Internals.PolySpatialInstanceID parentId) (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Platforms/Unity/UnitySceneGraph.cs:310)
Unity.PolySpatial.Internals.PolySpatialUnityBackend.OnSendClientCommand (Unity.PolySpatial.Internals.PolySpatialCommand command, System.Int32 argCount, System.Void** args, System.Int32* argSizes) (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Platforms/Unity/PolySpatialUnityBackend.cs:280)
Unity.PolySpatial.Internals.PolySpatialUnityBackend.HandleCommand (Unity.PolySpatial.Internals.PolySpatialCommand cmd, System.Int32 argCount, System.Void** argValues, System.Int32* argSizes) (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Platforms/Unity/PolySpatialUnityBackend.cs:77)
Unity.PolySpatial.Internals.PolySpatialNativeExtensions.Command[T1,T2] (Unity.PolySpatial.Internals.IPolySpatialCommandHandler handler, Unity.PolySpatial.Internals.PolySpatialCommand command, T1* arg1, T2* arg2) (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Platforms/PolySpatialNativeExtensions.cs:135)
Unity.PolySpatial.Internals.PolySpatialUnitySimulation.OnHierarchyChanged (Unity.Collections.NativeArray`1[T] children, Unity.Collections.NativeArray`1[T] parents) (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/PolySpatialUnitySimulation.cs:657)
Unity.PolySpatial.Internals.TransformTracker.ProcessNewTransforms (System.Collections.Generic.List`1[T] newGameObjects) (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/TransformTracker.cs:109)
Unity.PolySpatial.Internals.GameObjectTracker.ProcessChanges (Unity.PolySpatial.Internals.PolySpatialUnitySimulation unitySimulation, Unity.PolySpatial.Internals.IChangeList`1[TEngineData] data) (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/GameObjectTracker.cs:39)
Unity.PolySpatial.Internals.UnityObjectTracker`3[TObject,TEngineData,TTrackingData].ProcessAllNewAndModifiedObjects () (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/UnityObjectTracker.cs:265)
Unity.PolySpatial.Internals.UnityObjectTracker`3[TObject,TEngineData,TTrackingData].ProcessNewAndModifiedObjects () (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/UnityObjectTracker.cs:234)
Unity.PolySpatial.Internals.PolySpatialUnityTracker.Process () (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/PolySpatialUnityTracker.cs:187)
Unity.PolySpatial.Internals.PolySpatialUnitySimulation.Update () (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/PolySpatialUnitySimulation.cs:169)
Unity.PolySpatial.Internals.PolySpatialCore.PolySpatialAfterLateUpdate () (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/PolySpatialCore.cs:573)
UnityEngine.Debug:LogException(Exception)
Unity.PolySpatial.Internals.PolySpatialCore:PolySpatialAfterLateUpdate() (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/PolySpatialCore.cs:580)

I’ve tried disabling basically all trackers, but to no avail.

Thanks

Hello! Is it possible that, though the GameObject is in a disabled layer, a child of it is not? That’s the origin of this error: you can’t have tracked children of non-tracked objects.

That makes a lot of sense, thanks! I’ll try and clear up our hierarchies

It’d really be wonderful if Unity PolySpatial could start implementing error handling with meaningful logs or exceptions for when things like this occur that are known to be issues. It’s so difficult, frustrating and time consuming otherwise.

2 Likes

We will try to do so in the future! Keep in mind that we’re a small team and that the state space of things that can affect (e.g., break) PolySpatial is very large.

Please file a bug report on this. This way we can get it tracked and scheduled for some future release.

Bug for proper logging has been filed

IN-62603

2 Likes