[visionOS] Detect Whether PlayToDevice is Enabled

It’d be great to have a way of knowing whether PolySpatial Play-to-Device is enabled in the Editor and at Runtime. Is this currently possible?

At present, my project uses the XR Environment simulation in the Editor. In order to deactivate this, I need to enable PolySpatial in the Standalone tab of the XR Plug-In Manager. In addition, there are some moments during runtime where it would be great to know if Play-to-Device is running, so that I can adjust my setup accordingly.

I tried using asmdefs to give my script access to the PlayToDevice namespace/class, but I couldn’t get it to work. Even if I had, I don’t think the “Enabled” property is exposed, so I’m not sure how I’d get it.

There’s PolySpatialUserSettings.Instance.ConnectToPlayToDevice, but that only tells you whether the system will attempt to connect to Play to Device when entering play mode in the editor with PolySpatial enabled (i.e., visionOS build target, RealityKit/Hybrid app mode). It won’t tell you whether connection was successful. I think we’ve had requests for that functionality before; if it’s something you’re interested in as well, you could submit it to our road map.

You know what, this might sorta be all I need. Thanks a lot!

1 Like