Skip to main content
Inspiring
February 4, 2016

Unity 5.3 OVR bad rotation init

I'm a developer for Unity+VR, both Oculus DK2 and GearVR and I use Oculus Utilities v0.1.3.

I've noticed a strage Issue switching from Unity 5.2.2p4 to Unity 5.3.2.p1: Virtual reality initializes/resets at the beginning of the programs in a strange manner. The issue is clearly visible with my GearVR innovator edition (Note 4 version): if I start a program builded with this Version of Unity with the head all tilted, the world will result all strangely inclined. With DK2 I also have some strange behaviour with my particular program, but I can't say you how to replicate this.
We made the tests using 2 GearVR with 2 Note4 and the results are the same. Building with Unity 5.1.x or 5.2.x solves the issue.
In Editor, with DK2 attached, everything works super-fine.

I've searched this problem using google, but with no luck. Have you any suggestions? (Maybe it is a bug)
    This topic has been closed for replies.

    22 replies

    Inspiring
    October 10, 2016
    It hasn't been fixed yet. Currently you need to create Cameras in Awake or Update instead of Start.
    New Participant
    January 31, 2017
    I still see this issue in the latest version of Unity but I was able to fix it by commenting some lines of the OVRManager out like so.





    private void UpdateAnchors()
    {
    bool monoscopic = OVRManager.instance.monoscopic;

    OVRPose tracker = OVRManager.tracker.GetPose();

    trackerAnchor.localRotation = tracker.orientation;
    //centerEyeAnchor.localRotation = VR.InputTracking.GetLocalRotation(VR.VRNode.CenterEye);
    leftEyeAnchor.localRotation = monoscopic ? centerEyeAnchor.localRotation : VR.InputTracking.GetLocalRotation(VR.VRNode.LeftEye);
    rightEyeAnchor.localRotation = monoscopic ? centerEyeAnchor.localRotation : VR.InputTracking.GetLocalRotation(VR.VRNode.RightEye);
    leftHandAnchor.localRotation = OVRInput.GetLocalControllerRotation(OVRInput.Controller.LTouch);
    rightHandAnchor.localRotation = OVRInput.GetLocalControllerRotation(OVRInput.Controller.RTouch);

    trackerAnchor.localPosition = tracker.position;
    //centerEyeAnchor.localPosition = VR.InputTracking.GetLocalPosition(VR.VRNode.CenterEye);
    leftEyeAnchor.localPosition = monoscopic ? centerEyeAnchor.localPosition : VR.InputTracking.GetLocalPosition(VR.VRNode.LeftEye);
    rightEyeAnchor.localPosition = monoscopic ? centerEyeAnchor.localPosition : VR.InputTracking.GetLocalPosition(VR.VRNode.RightEye);
    leftHandAnchor.localPosition = OVRInput.GetLocalControllerPosition(OVRInput.Controller.LTouch);
    rightHandAnchor.localPosition = OVRInput.GetLocalControllerPosition(OVRInput.Controller.RTouch);

    if (UpdatedAnchors != null)
    {
    UpdatedAnchors(this);
    }
    }



    The UpdateAnchors gets called in the Start function of the OVRCameraRig and the centerEyeAnchor update that has been commented out is totally unnecessary and just confuses Unity when the rig is activated.