Showing results for 
Search instead for 
Did you mean: 

GearVR Controller in editor

Level 3
I'm having trouble getting the GearVR controller to work in the Unity Editor.

Here's my basic script (attached to a simple GameObject):
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Wand : MonoBehaviour {
    void Update() {
        transform.rotation = OVRInput.GetLocalControllerRotation(OVRInput.Controller.RTrackedRemote);

    public Transform controller;
    public static bool leftHanded { get; private set; }
    void Awake() {
        #if UNITY_EDITOR
        leftHanded = false;        // (whichever you want to test here)
        leftHanded = OVRInput.GetControllerPositionTracked(OVRInput.Controller.LTouch);
    void Update() {

        OVRInput.Controller c = leftHanded ? OVRInput.Controller.LTouch : OVRInput.Controller.RTouch;
        if (OVRInput.GetControllerPositionTracked(c)) {
            controller.localRotation = OVRInput.GetLocalControllerRotation(c);
            controller.localPosition = OVRInput.GetLocalControllerPosition(c);

Unity Editor log:


Note that the Unity Editor says "Virtual Reality SDK Oculus failed to initialize." as a warning, though I think that makes sense since there's no Rift or native windows VR device connected

I've dragged the OVRCameraRig prefab into the scene, and can emulate that by holding control and moving the mouse

I've connected my GearVR controller via bluetooth

Added the Oculus ID to settings

Created a sig file and added it to the project

Help please 🙂

Level 3
Also - UnityEngine.Input.GetJoystickNames(); returns an empty list