Search Unity

Disable VR (HTC Vive) for specific scene?

Discussion in 'AR/VR (XR) Discussion' started by Vapid-Linus, Jun 1, 2016.

  1. Vapid-Linus

    Vapid-Linus

    Joined:
    Aug 6, 2013
    Posts:
    64
    I have a game that is played with VR but I also have a map editor in the game. I want the map editor to be played like a normal non-VR game using your mouse and keyboard. Does anyone knows how I can disable the HTC Vive/SteamVR with code?

    I have tried the following but it doesn't do anything.
    Code (CSharp):
    1. UnityEngine.VR.VRSettings.enabled = false;
    2. SteamVR.enabled = false;
    I also tried this but it crashes Unity:
    Code (CSharp):
    1. OpenVR.Shutdown();
    The reason I want to disable it is so the HMD will turn of, to prevent screen burn-in or overheating.
     
  2. scottunity

    scottunity

    Joined:
    Feb 1, 2014
    Posts:
    72
    So you want people to take the HMD on and off or is this a totally different task?
    Would it be better as a different app - map editor, from the game itself?
     
  3. tango209

    tango209

    Joined:
    Feb 23, 2011
    Posts:
    379
    Have you tried disabling the VR camera gameobject and enabling a 'normal' camera in that scene?
     
    AlanOToole likes this.
  4. GoesTo11

    GoesTo11

    Joined:
    Jul 22, 2014
    Posts:
    604
    I don't know if this helps but a screen space overlay UI does not show up in the hmd but will show up on screen.
     
  5. WandMagic

    WandMagic

    Joined:
    Jul 20, 2016
    Posts:
    2
    Like goes to 11 Said, screen space overlay works well.
     
  6. Banksy

    Banksy

    Joined:
    Mar 31, 2013
    Posts:
    376
    wondering if you managed to find a solution to the Vive camera and monitor ?

    I'm trying to do the same
     
  7. mitis

    mitis

    Joined:
    May 21, 2013
    Posts:
    51
    1. using UnityEngine;
    2. using UnityEngine.VR;

    3. public class NegateTracking: MonoBehaviour
    4. {
    5. void Update()
    6. {
    7. transform.position = -InputTracking.GetLocalPosition(VRNode.CenterEye);
    8. transform.rotation = Quaternion.Inverse(InputTracking.GetLocalRotation(VRNode.CenterEye));
    9. }
    10. }