Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Login in Non VR Mode and use app on VR mode

Discussion in 'Windows Mixed Reality' started by diegosdias, Jun 26, 2018.

  1. diegosdias

    diegosdias

    Joined:
    Jul 26, 2016
    Posts:
    12
    Hello,
    I am developing a VR application where I would the user to do a login on a non VR screen (so he can easily type his username/password), and then seitch to VR so he can have the full experience.

    Trying to use XRSettings.enabled doesn't seem to work.

    Any suggestions on how to do that?
     
  2. IElectric

    IElectric

    Joined:
    May 31, 2016
    Posts:
    131
  3. diegosdias

    diegosdias

    Joined:
    Jul 26, 2016
    Posts:
    12
    Thanks for the link and the answer.
    I was able to do a similar solution to what you did.
     
  4. diegosdias

    diegosdias

    Joined:
    Jul 26, 2016
    Posts:
    12
  5. IElectric

    IElectric

    Joined:
    May 31, 2016
    Posts:
    131
    Hello, I have a little bit problem to publish the update of my game on the store, because the windows mixed reality feature has a strange behavoir.

    If I run the windows mixed reality when the game is already started the windows mixed reality portal lock the desktop and my game lost the focus, I need to press WIN+Y to unlock the WMR portal windows and switch the focus on my game to continue.

    If I have already running the WMR portal and start my game in standalone mode and next go in virtual reality mode the focus remain on my game and the virtual reality works properly.

    Can someone help me to understand how to still the focus on my game when start Windows Mixed Reality portal ? thank you very much, Best regards...

    PS: I'm using Unity 2018.1.6
     
  6. IElectric

    IElectric

    Joined:
    May 31, 2016
    Posts:
    131
    Hello, I have found the problem but I don't know how to solve it.

    If XR settings are set as "Windows Mixed Reality" as first the game start correctly in WMR mode and works well also if the game start inside the Windows Mixed Reality Portal.

    xr1.png

    If XR settings are set as "None" as first the game start in desktop mode, with the "LoadDeviceByName" function is possible to enable the Windows Mixed Reality mode but the desktop is locked on the WMR window and inside the visor the screen is black, this happen in the UWP build version and not in the Unity Editor.

    If the game is started in the same way as above explained but inside the Windows Mixed Reality Portal, the game start in WMR mode but show black screen and some animated white balls.

    xr2.png

    On the Unity manual is explained that is possible to start in None mode and than run in Windows Mixed Reality mode, is the behavoir that I like to use on my game, start in desktop mode and then switch to VR mode, but I don't understand how to do it, Best Regards…

    xr.png
     
  7. IElectric

    IElectric

    Joined:
    May 31, 2016
    Posts:
    131
    Hello, I try to explain what happen on my case :

    I'm using Unity 2018.1.6f1 and the latest version of visual studio 2017 community, I have a game on microsoft store and I'd like to upgrade it with virtual reality support;

    I have succesfull build an UWP game and I have installed it on my computer;

    When the game start it's works as desktop game;

    When I select the virtual reality mode the game start the windows mixed reality portal and the game run through the visor as shown;

    If I start the game inside the windows mixed reality portal the game start normally;

    When I select the virtual reality mode the windows mixed reality portal show a black windows with some white circles;

    I don't know if it is a Unity issue but I'm stuck and I can't publish a virtual upgrade of my game in the microsoft store, because with this behavoir the game doesn't pass the submission;

    Thank you very much for patience, Best regards...
     
    Last edited: Dec 30, 2018
  8. IElectric

    IElectric

    Joined:
    May 31, 2016
    Posts:
    131
    Solved, by switching on "run in background" option the game doesn't lost the focus and still active during the transition from standalone UWP to Virtual Reality;

    back.png

    Another tricks is to force the execution of the game to full screen in the script code;

    Now the game works perfectly both on desktop and inside the Windows Mixed Reality portal, I hope to was useful for other people, stay tuned for the next Virtual Reality update of uVolley…

    https://www.microsoft.com/store/apps/9P5GJQXZL1BQ

    Best Regards...
     
    Last edited: Jul 6, 2018
    arufolo and cyraxchel like this.
  9. arufolo

    arufolo

    Joined:
    Mar 5, 2013
    Posts:
    5
    Are you using WMR controllers? Whenever I set "None" as my first VR SDK, WMR controllers will not load properly. Specifically, the line:
    Code (CSharp):
    1. IReadOnlyList<SpatialInteractionSourceState> sources = SpatialInteractionManager.GetForCurrentView().GetDetectedSourcesAtTimestamp(PerceptionTimestampHelper.FromHistoricalTargetTime(DateTimeOffset.Now));
    Will return an empty array. When WMR SDK is set first, this line returns the two WMR motion controllers. Any thoughts?