If youâre developing VR applications with Unity and Oculus Integration, you might have encountered a frustrating issue: Unity crashes every time you exit Play mode. This problem has been affecting many developers, particularly with Oculus Integration version 32. In this guide, Iâll walk you through the exact steps to fix this issue and get your development workflow back on track.
When using Oculus Integration in Unity (particularly version 32 at the time of this writing), you may experience the following scenario:
UnityEngine.SubsystemBindings.DestroySubsystem
This crash is not caused by your code or project setup - itâs related to how the Oculus Integration package interacts with Unityâs XR systems, particularly around the new OpenXR backend.
The fix involves reinstalling the Oculus Integration package and making specific choices during the setup process. Hereâs how to resolve the issue:
First, we need to completely remove the current Oculus Integration package:
At this point, youâll notice that any Oculus-related components in your scene (like the OVR Player Controller) will be missing their references.
Now weâll reinstall the Oculus Integration package, but with specific settings:
This is the most important part. After importing, youâll receive a series of popup dialogs. Hereâs how to respond to each one:
First popup - âNew plugin detectedâŠâ - Click Yes
Second popup - âOpenXR BackendâŠâ - Click Cancel
Third popup - âThe standard legacy OVR plugin will be activated by defaultâŠâ - Click Restart
Fourth popup - âAudio Spatializer PluginâŠâ - Click Yes
Final popup - âPlugin was updatedâŠâ - Click Restart
After Unity restarts:
Unity should now exit Play mode without crashing!
The key to fixing this issue is avoiding the OpenXR backend thatâs included in Oculus Integration. While OpenXR is the future standard for XR development, the implementation in Oculus Integration version 32 has compatibility issues with Unityâs subsystem management.
By choosing the legacy OVR plugin instead, you bypass these compatibility issues while still having full access to Oculus functionality.
This seemingly simple issue can cause major headaches for VR developers, leading to lost time and frustration. By following the steps outlined above, you can avoid the Unity crashes when exiting Play mode and maintain a smooth development workflow.
Remember that VR development tools are constantly evolving, and sometimes these kinds of issues arise during transitional periods between different standards and implementations. Staying informed about workarounds like this can save you countless hours of troubleshooting.
If youâre experiencing this frustrating crash, check out my solution in the video walkthrough here.
For those working on VR projects, I recommend checking out VRIF (VR Interaction Framework) which you can find at: https://tinyurl.com/vrframework
Iâd love to chat with you about any VR development challenges youâre facing! Join my Discord server at: https://discord.com/invite/CVNuqSZ
If you appreciate my content, please consider becoming a Patreon member: http://www.patreon.com/sharkjets
The music In this tutorial is by Flawed Human Being, who you can find on Spotify: https://open.spotify.com/artist/0ywnFmJWQwP4adEG9otvYA