Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Question XRDevice.isPresent’ is obsolete

Discussion in 'XR Interaction Toolkit and Input' started by dsantamonica, Feb 13, 2021.

  1. dsantamonica

    dsantamonica

    Joined:
    Jan 24, 2019
    Posts:
    22
    I updated a project to 2022.2 and got the following error message for the WebVRController and Manager scripts:

    XRDevice.isPresent’ is obsolete: ‘This is obsolete and should no longer be used. Instead, find the active XRDisplaySubsytem and check that the running property is true (for details, see XRDevice.isPresent documentation);

    I’m an inexperienced Unity user and couldn’t figure out what to do and didn’t find any help in the manual.

    Any suggestions?
     
  2. dsantamonica

    dsantamonica

    Joined:
    Jan 24, 2019
    Posts:
    22
    Since I didn't get any response here, I'm going to move this question to a different part of the forum (as soon as I figure out where I might have more luck :)
     
  3. thep3000

    thep3000

    Unity Technologies

    Joined:
    Aug 9, 2013
    Posts:
    399
    If you double click on that error message, it will take you to a script that is using `XRDevice.isPresent` ..

    Take the code from the example here: https://docs.unity3d.com/ScriptReference/XR.XRDevice-isPresent.html and replace the XRDevice.isPresent call with call to isPresent().

    I'm not exactly sure how your WebVRController is utilizing the isPresent property, but it may not be necessary. You can also try replacing it with `true` or some other check to see if webVR is available.