Search Unity

Switch from SteamVR to XR

Discussion in 'AR/VR (XR) Discussion' started by ianfrank, Jul 11, 2020.

  1. ianfrank

    ianfrank

    Joined:
    Feb 20, 2018
    Posts:
    5
    Hi there!

    I need a bit of advice. I'm a Unity beginner, and i started developing a small VR game a few years ago in 2017, then took a break until now. I managed to upgrade the project to Unity 2019, though i've forgotten a lot of how Unity works. I have a Windows Mixed Reality headset, and back then i used SteamVR to get things running.

    There is a small demo of the game here if you're interested :


    Now i see that Unity recommends that i use XR plugins instead of Mixed Reality Toolkit, and perhaps also instead of SteamVR, i am not sure.

    What would you guys recommend? Finish the game with SteamVR, try to use Mixed Reality Toolkit instead, or switch to the new XR stuff? Or perhaps even start over and recreate the whole thing. I need to learn Unity all over again anyways, since i have forgotten almost everything. =)

    Thanks in advance! :)
     
  2. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    There's some learning and work involved upfront but I highly recommend you switch to the new XR stuff and save yourself future headache. In fact this is exactly what I am doing now (XR management + new input system). New XR is much cleaner and so much easier to troubleshoot.

    I'd use the XR management +WMR XR plugin. Just do some testing on an empty project, get a hang of it.
     
  3. ianfrank

    ianfrank

    Joined:
    Feb 20, 2018
    Posts:
    5
    Wow, i totally missed your reply - thank you!! I got sidetracked back in July, but am now starting to convert my project to 2019.5 and using the new XR. Fingers crossed! :)
     
  4. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    I might we wrong, but I think you cant use all SteamVR 2.0 binding stuff with XR vanilla. You need the steam plugin for this.
     
  5. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    The other way around. The new input system does not work with Valve devices yet. They are working on this at the moment.

    Currently, I am using the new Unity input system for anything that is not Valve. For value (unfortunately) I still have to use the Valve bindings and valve input system.

    I just created a wrapper/intermediate input system so that I can simply remove the steam stuff at any time I want without affecting the game.
     
  6. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    Yeah we have the same abstraction in our game. Though I wonder if XR input ever will be as flexible as steamvr. For example we use the priority stuff.

    Code (CSharp):
    1.        /// <summary>
    2.         /// Activate this set so its actions can be called
    3.         /// </summary>
    4.         /// <param name="disableAllOtherActionSets">Disable all other action sets at the same time</param>
    5.         /// <param name="priority">The priority of this action set. If you have two actions bound to the same input (button) the higher priority set will override the lower priority. If they are the same priority both will execute.</param>
    6.         /// <param name="activateForSource">Will activate this action set only for the specified source. Any if you want to activate for everything</param>
    7.         public void Activate(SteamVR_Input_Sources activateForSource = SteamVR_Input_Sources.Any, int priority = 0, bool disableAllOtherActionSets = false)
    8.         {
    9.             setData.Activate(activateForSource, priority, disableAllOtherActionSets);
    10.         }

    When you pickup a item in our game the ActionSet it uses gets it priority upgraded from 0 to 2. This makes for very flexible stick locomotion.
     
  7. ianfrank

    ianfrank

    Joined:
    Feb 20, 2018
    Posts:
    5
    Thanks again for your replies. :)

    I've spent a lot of time trying to wrap my head around the current VR situation in Unity, reading up and down about the OpenXR, Unity XR and SteamVR issues, and I am still a bit undecided in which way to go. It's a bit of a mess, as far as i can see..

    I am a Unity beginner, and my current game (the one that started in 2017) is built around SteamVR plugin 1.2.3, which is deeply integrated in a lot of scripts. Since Unity XR doesn't work properly with Steam, i tried to go for SteamVR 2.x, but it's really hard to convert my project. Also, if i want to release for WMR and Oculus, i need to remove the SteamVR plugin and switch everything to Unity XR, if i understand things correctly.

    It is possible to install SteamVR and use it with Unity XR, using the github 3rd party stuff, but i find it a bit unreliable - and i still need to remove SteamVR to publish for Oculus anyway.

    So.. right now i stick with SteamVR 1.2.3 in Unity 2019.4, and when the game is done and released on Steam, i will try to make things running using Unity XR, to target Oculus and WMR.

    But.. is there any reason why i should avoid using SteamVR 1.2.3? Everything works like a charm using that right now. :) What are your thoughts about that?
     
  8. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    @ianfrank SteamVR is easy to get started and get going with especially for those who are somewhat new. Maybe keep using it until Unity finishes with the new XR stuff, especially if it's already working for you and the players. I mean, why change it if does what you want and you are happy with it right?

    Here's my take on this. If you stick to what SteamVR gives you everything works ok, but I find it hard (rather an absolute nightmare) to troubleshoot and extend/expand as your scope changes. I Just don't like to rely on a very bloated third-party plugin that is external to Unity. I just think input should be handled by the game engine which gives me full control of how and what I want to do.

    I would say at least play around in the new XR and the input system and get used to it. Because sooner or later SteamVR is going to be the "legacy" way of doing things. I personally find it much, much cleaner, and easier to work with XR.
     
  9. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    You can do the same exact thing on the new input system. It has action sets also. You just have to manage them on your own.
     
  10. ianfrank

    ianfrank

    Joined:
    Feb 20, 2018
    Posts:
    5
    @FlightOfOne Yes, why fix it if it aint broken :) Well, i am uncertain if the old SteamVR v1.2.3 is still accepted when i want to publish the game to Steam, or if they require v2.0 to support new controller. Also, since i only have a WMR headset, i'm not even sure how it works with ie. HTC Vive.

    I do have Oculus Quest 1 + 2 also, so perhaps i'll leave steam behind for now, and start working on Unity XR to release for Oculus (and perhaps WMR). How does that sound?

    And THANK YOU for taking the time to help a rookie reboot his gamedev career. ;)
     
  11. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198
    Steam VR 1.x doesnt even support Knuckles or Action sets. I would upgrade to 2.0 atleast. You can migrate to UNity XR Input at a later date though
     
  12. ianfrank

    ianfrank

    Joined:
    Feb 20, 2018
    Posts:
    5
    @MDADigital thank you, exactly what i needed to know. I wouldn't want to rely on something thats outdated from the start, only to run into trouble later.

    I'm going for Oculus using XR to begin with, then i'll see how far SteamVR integration has become once i'm done. :)