Maybe it is intentional that vr support checkbox and many other player settings (from “other settings”) are missing in the latest beta 5.1.0.b4?! Although VR activated projects does not work correctly in beta4, camera positions is not correct!
This is a bug – A work around for now is to access the PlayerSettings api directly in an editor script – ex. PlayerSettings.virtualRealitySupported = true;
I made this and put it in my project’s editor folder:
using UnityEngine;
using System.Collections;
using UnityEditor;
class CustomSettings : EditorWindow {
void OnGUI()
{
PlayerSettings.virtualRealitySupported = true;
}
}
It doesn’t change anything though. What am I doing wrong?
Following this example Unity - Manual: Editor Windows I also tried this:
using UnityEditor;
using UnityEngine;
public class MyWindow : EditorWindow
{
string myString = "Hello World";
bool groupEnabled;
bool myBool = true;
float myFloat = 1.23f;
// Add menu item named "My Window" to the Window menu
[MenuItem("Window/My Window")]
public static void ShowWindow()
{
//Show existing window instance. If one doesn't exist, make one.
EditorWindow.GetWindow(typeof(MyWindow));
}
void OnGUI()
{
GUILayout.Label("Base Settings", EditorStyles.boldLabel);
myString = EditorGUILayout.TextField("Text Field", myString);
groupEnabled = EditorGUILayout.BeginToggleGroup("Optional Settings", groupEnabled);
myBool = EditorGUILayout.Toggle("Toggle", myBool);
myFloat = EditorGUILayout.Slider("Slider", myFloat, -3, 3);
EditorGUILayout.EndToggleGroup();
PlayerSettings.virtualRealitySupported = true;
}
}
I added PlayerSettings.virtualRealitySupported = true; to the end, opened MyWindow through the menu which shows up like it should, but VR is still not working.
I’ve never worked with editor scripts before. A working example of how to do this would be appreciated.
Tip for anyone reverting from beta 4 back to beta 3:
To get VR to work in beta 3 after trying it unsuccessfully in beta 4, you have to uncheck Virtual Reality Supported and then check it again in beta 3.
Just tried beta 4 and now it’s working with that editor script. Not sure if it was just having to restart the editor or what.