Switching to cardboard cause incorrect display of cameras

Hi

While developing my VR mobile app, I encountered big problem/bug. When I launch my app in standard (non VR) mode and trying to switch to VR (cardboard) strange things are going on with cameras. The dividing line and cardboard buttons (settings back) are ok, but cameras both for left and right eye, are smaller then screen size and cut in half (see photo - screen was whole black).

What is very strange when I push Overview button and press back to my app, everything is fine.

I have carboard configured.

Code for enable cardboard:
GvrViewer.Instance.VRModeEnabled = true;

SDK 0.9.1
Unity 5.4.0
Platform Android (iOS too)





I believe i found the issue.

It’s all becouse of autorotation.

Scenario:

  • scene 1 portrait
  • loading scene 2 which is landscape
  • open scene 2 (in start script there was changing screen orientation)
  • open cardboard
  • BUG!

The solution

  • load scene async
  • at 90% of loading change rotation (still in scene1)
  • open scene 2
  • everything works as expected.

Hope it would help someone.