Search Unity

Correct way to check if VR is enabled

Discussion in 'VR' started by Kronnect, Dec 22, 2019.

  1. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Hi,

    Regarding this warning:

    "warning CS0618: 'PlayerSettings.virtualRealitySupported' is obsolete: 'This API is obsolete, and should no longer be used. Please use XRManagerSettings in the XR Management package instead.'

    How can we detect at runtime if VR is enabled without installing the XR Management package itself?
    Or alternatively, if that package is going to be optional in the future, how can we detect if it's installed and avoid checking if VR is enabled if not?