Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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:
    400
    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.