PolySpatial package breaks app UI in Editor play mode

We’re porting an iOS app to visionOS. This app uses UI dialogs in screen-space, for onboarding and login purposes. If I add the PolySpatial packages and run the app in the Editor, these dialogs work for exactly one time. Then, Unity automatically makes some modifications to the following files:

  • DynamicsManager.asset
  • TagManager.asset

As soon as these modifications have happened, the UI won’t work anymore in Editor play mode. The click events are not recognized anymore.

With some experiments I found out that the actual culprit is the modification to the TagManger file which adds two new layers: PolySpatial, and PolySpatialUI. If I revert these changes, the UI works again. Until I leave Play mode and the file changes will be applied again.

I also noticed that sometimes only the “sorting layers” in this file are modified, while at other times (e.g. on second run) also a “PolySpatial” layer is added, but no “PolySpatialUI” layer. If I delete the “PolySpatial” layer manually in the tag editor, it will be re-added again (always on position 31).

Reverting the DynamicsManager changes does not have any effect. It seems as if just the additional “sorting layers” in the TagManager file break my UI. Once I revert these, everything returns back to normal. Until the file is touched by Unity again.

What is the reason for this behavior?