Switch Between LandScape and Portrait

I have one scene that is Landscape mode to allow for menu and starting game.

Once game started the next scene is portrait.

How do I go about having the phone rotate the view automatically? Currently the portrait scene does not scale correctly or rotate automatically.

Well, the engine can only tell the system whether portrait mode and landscape mode are wanted by the game, but we can’t tell the system to switch with configuration files. So you would probably need to review docs from Android and iOS for how to request the phone to switch, I’m not sure it’s even possible.

Tricky solution would be support both rotation and detect for window resize event, manually adapt your scene to the wanted orientation in the resize callback.

That sounds more like what I would want, I still want the user to physically do the orientation, but would like the scene to resize and such correctly. Similar to how in debug mode you can click rotation button and it auto rotate the scene so user knows to change.

1 Like