Search code examples
androidunity-game-enginedevice-orientationgoogle-cardboard

Google cardboard device orientation


I'm wondering... is there any way to set the device orientation back to 'Auto Rotation'? I need a portrait rotation for my app main screen but once Cardboard SDK package is imported landscape mode seems to bypass everything in the project and there is no way to change it in any scene and I can't even get the orientation from Input.deviceOrientation (is always 'unknown').

So far my only idea is to use a second standard camera in ninety degree angle to get my dispay in portrait-mono mode and check the angle to manually get the change to portrait or landscape input.

I still didn't try this but it seems to me that it will work but isn't certainly an elegant solution...

... so anyone knows if it's possible to do something similar to the built in 'Auto Rotation' or has a better proposal than mine for this task?


Solution

  • Ok, after some research I've found the issue. The AndroidManifest file in Pugnis/Android path has a line which overwrites the rotation status: 'android:screenOrientation="landscape". Just deleting that line auto rotation is working properly