S
S
stasersmailov2021-04-12 16:00:51
Unity
stasersmailov, 2021-04-12 16:00:51

How to correctly change the orientation of the scene?

Hello, I am writing a game for android, the whole game is in portrait orientation, but 1 scene should be in horizontal.

Scene opening function

public void Open()
    {
       Screen.orientation = ScreenOrientation.LandscapeLeft;      
        
       SceneManager.LoadScene(SceneId);
    }


Also in the scene itself in the script in Awake () and in Start () it is written ScreenOrientation.LandscapeLeft
(I just tried to shove it anywhere that would work)

And as a result, the scene starts but with 1 canvas element (background) some kind of trouble it disappears, but if you restart the same scene, it appears and there are no problems

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question