Google Cardboard not move the camera when I'm using Unity Remote 4

Google Cardboard seems not to be compatible with the Unity Remote 4, for when I move my head a camera does not move.

As of as of Cardboard SDK 0.5.2, there’s an easy solution to this problem. Make a new script called GyroscopeEnable.cs and paste the following code:

    #if UNITY_EDITOR
    
    using UnityEngine; 
    using System.Collections;
    
    public class GyroscopeEnable : MonoBehaviour
    {	
       private Gyroscope gyro;

    	void Start ()
    	{
    		if (SystemInfo.supportsGyroscope) {
    		    gyro = Input.gyro;
                gyro.enabled = true;
    		}
    	}
    }
    
    #endif

Attach this script to a new GameObject in the editor. After that, go to line 74 of UnityEditorDevice.cs and change the line to read:

if (RemoteCommunicating) {

Voila, head tracking via Unity Remote 4 should now work.

Apparently that feature is on the way: http://vrfocus.com/archives/15842/unity-remote-coming-to-google-cardboard-sdk/

I’m using v0.7 on Windows 7 with a Nexus 5

Changing line 74 (now line 68) of Assets/Cardboard/Scripts/VRDevices/UnityEditorDevice.cs to read …

if (/*Cardboard.SDK.UseUnityRemoteInput &&*/ RemoteCommunicating ) {

… seems to do the trick all on its own.

(Without version numbers, working out which line was “74” took a non trivial amount of time so I feel that a new answer is justified. Also, I’m delighted that I don’t need another behavior)

works with Unity 5.3.1 and Cardboard SDK 0.6
waiting for official release!

thank you

I’m trying with Unity 5.3.3 to get a stereoscopic 360 view for generic iPhone goggles,
do you know if this is a good path ?

The very simple mode is just change the value of the field UseUnityRemoteInput:
Find the field UseUnityRemoteInput on the GvrViewer.cs class and change the value to True.

But, If you want something more polite, you cam transform UseUnityRemoteInput into a property, create a private field useUnityRemoteInput and in the GvrViewerEditor.cs, into OnInspectorGUI, add the UseUnityRemoteInput property for dislplay into IDE.

GvrViewer.cs

Before:

public bool UseUnityRemoteInput = false;

After:

    /// Use unity remote as the input source.
    public bool UseUnityRemoteInput {
        get
        {
            return useUnityRemoteInput;
        }
        set
        {
            if (value != useUnityRemoteInput)
            {
                useUnityRemoteInput = value;
                if (device != null)
                {
                    device.UpdateScreenData();
                }
            }
        }

    }
    [SerializeField]
    private bool useUnityRemoteInput = false;

GvrViewerEditor.cs

Before:

GUIContent editorSettingsLabel = new GUIContent("Unity Editor Emulation Settings",
        "Controls for the in-editor emulation of a Cardboard viewer.");

After:

GUIContent editorSettingsLabel = new GUIContent("Unity Editor Emulation Settings",
        "Controls for the in-editor emulation of a Cardboard viewer.");

    GUIContent UseUnityRemoteInputLabel = new GUIContent("Use unity remote as the input.",
        "When you can use Unity Remote Gyro");

And on the OnInspectorGUI method:

Before:

EditorGUILayout.LabelField(editorSettingsLabel, headingStyle);
        gvrViewer.autoUntiltHead =
            EditorGUILayout.Toggle(autoUntiltHeadLabel, gvrViewer.autoUntiltHead);

After:

EditorGUILayout.LabelField(editorSettingsLabel, headingStyle);
        gvrViewer.autoUntiltHead =
            EditorGUILayout.Toggle(autoUntiltHeadLabel, gvrViewer.autoUntiltHead);
        gvrViewer.UseUnityRemoteInput =
            EditorGUILayout.Toggle(UseUnityRemoteInputLabel, gvrViewer.UseUnityRemoteInput);

The result:
alt text