Log in or register to post comments

Android/IOS portrait to landscape changes

October 16, 2014 - 6:39am #1

Hi, apologies if this has been answered, I have searhed but could not find a specific answer.

 

My app porting to Android and IOS is set as landscape only in build settings because the menu that I have created in a menu scene is landscape only and all works well across the devices.

However I need the AR scenes to be portrait and landscape so that user interaction, finger gestures etc work correctly but although the camera and model appear the correct way it is obvious the app is still reacting to landscape whren in portrait.

Is there a way to have the app set as landscape only so the menu is correct and when an AR option is selected and opens it is reset to portrati and landscape and then when returning to the menu returns to landscape only?

 

Thanks in advance

 

 

Android/IOS portrait to landscape changes

October 19, 2014 - 9:42am #3

Thanks for giving me the heads up, apprecisted ;-0

Android/IOS portrait to landscape changes

October 18, 2014 - 2:19am #2

http://docs.unity3d.com/ScriptReference/Screen.html explains how to do it. I did not try but it should work.

on your main scene call the following on a "Start" function.


            Screen.orientation = ScreenOrientation.AutoRotation;
            Screen.autorotateToLandscapeLeft = true;
            Screen.autorotateToLandscapeRight = true;
            Screen.autorotateToPortrait= false;
            Screen.autorotateToPortraitUpsideDown= false;

and on your camera scene call the following on "Start".

            Screen.orientation = ScreenOrientation.AutoRotation;
            Screen.autorotateToLandscapeLeft = true;
            Screen.autorotateToLandscapeRight = true;
            Screen.autorotateToPortrait= true;
            Screen.autorotateToPortraitUpsideDown= true;

 

I hope this helps.

Log in or register to post comments