Search code examples
unity-game-engineuwpaugmented-realityhololenswindows-mixed-reality

UnityEngine.XR.WSA.WorldManager namespace not found, where does it reside now?


UnityEngine.XR.WSA.WorldManager is obsolete.

What is the up to date alternative for

UnityEngine.XR.WSA.WorldManager.GetNativeISpatialCoordinateSystemPtr();

or has WorldManager moved home?


Solution

  • Support for built-in XR is removed in the latest Unity version. The WinRT API, such as Windows.Perception.Spatial.SpatialLocator is the alternative for it. For your case, you can use var spatialCoordinateSystem = SpatialLocator.GetDefault().CreateStationaryFrameOfReferenceAtCurrentLocation().CoordinateSystem; to create a coordinate system with the origin placed at the device's position as the app is launched.