You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PolySpatial dependency prevents compilation for native Metal visionOS builds #76
Description
The com.apple.unityplugin.spatialcontroller package has a hard dependency on Unity.PolySpatial which causes compilation errors when building native Metal visionOS apps without PolySpatial installed.
(This bug was found and fixed by me during the Developer Lab in London)
To Reproduce
Steps:
Create a new Unity 6 project (6000.3.x) targeting visionOS
Configure for native Metal rendering (NOT using PolySpatial/RealityKit)
Install com.apple.unityplugin.spatialcontroller package from the unityplugins repository
Attempt to compile the project
Observe compilation error: error CS0234: The type or namespace name 'PolySpatial' does not exist in the namespace 'Unity'
Expected behavior
The SpatialController package should compile successfully without requiring PolySpatial, since PolySpatial is only needed for Unity's RealityKit conversion layer and is not required for native Metal visionOS development. The VolumeCamera bounded mode check is only used for a warning message and should be optional.
Screenshots
N/A - compilation error in console, won't compile with IL2CPP
Additional context
Files affected:
Apple/Scripts/apple.accessorytracking.asmdef - Line 8 references "Unity.PolySpatial" as a required assembly
Apple/Scripts/AccessoryTrackingHelper.cs - Line 14 imports Unity.PolySpatial for VolumeCamera class usage
Suggested fix:
Remove Unity.PolySpatial from the asmdef references array
Add a versionDefines entry to define UNITY_POLYSPATIAL when the package is present
Wrap the VolumeCamera code in AccessoryTrackingHelper.cs with #if UNITY_POLYSPATIAL conditional compilation
This allows the package to work with both PolySpatial-based projects and native Metal visionOS projects. I have got PSVR2 Controllers
Activity
ryzngard commentedon Jan 15, 2026
@sambam60 can you try #79 and see if that unblocks you?
Apple.SpatialController Support (apple#76)
Merge pull request apple#79 from apple/dev/kinifi/rdar-168153293