Godot: Android orientation setting ignored when running apk (always landscape)

Created on 5 Aug 2017  路  9Comments  路  Source: godotengine/godot

Operating system or device - Godot version:
Linux (Fedora 26, 64bit) to build apk
Nexus 5 - Android 7.1.1 to run apk

Godot 3-alpha1
Godot 3 (compiled from master)

Issue description:

Project is running on Android in landscape mode even though it was set to run in portrait mode. Orientation does not change if smartphone is rotated. Orientation is not affected by screen-orientation-lock of the smartphone.

Orientation should respect options set in export settings.

Steps to reproduce:

  1. Project Settings / Display / Window / Handheld / Orientation set to 'portrait' (also tested with 'Sensor')
  2. Export Android: Options / Screen / Orientation set to 'Portrait'
  3. Export apk
  4. Install apk
  5. See the wrong orientation being used

Edit:
It is working for 2.1.3 if the orientation is set to 'portrait' inside the project settings AND the android export settings. But the godot 3 versions are still only landscape.

bug android porting

Most helpful comment

I had the same issue, I fixed it by setting the orientation to portrait from Project Settings > Display > orientation. Seems like there are a few different settings for orientation and they all need to be in sync. I hope that helps

All 9 comments

I had the same issue, I fixed it by setting the orientation to portrait from Project Settings > Display > orientation. Seems like there are a few different settings for orientation and they all need to be in sync. I hope that helps

Never had a problem with that, I never used screen rotation

Thanks @petia-davidova
I was pretty sure I tried that with 2.1.3 but it seems I did not, because now everything works as expected.

But the godot 3 apk is still only running in landscape

I got it to work in Godot 3 by:

  • setting Export / Screen / Orientation to portrait
  • setting Project Settings / Display / Window / Handheld / Orientation to portrait

Had the same issue, my export setting set to portrait but missing the project setting. It works fine how @robert9g explains.

This has been resolved for a while now.

What is the point of having an orientation setting in two different places? It seems the one in Android export settings is consistently ignored and the one in project settings (which also has more options) is used instead. Whatever is set in the manifest (from export settings) there's a call to set the orientation when the app starts that forces the orientation (from project settings).

Could we just get rid of the one in export settings to make things less confusing?

+1 confusing to have orientation in export settings and project settings( I think it should only be in project settings like how iOS is) Also we need "user" and "fullUser" settings for Android, so user can lock rotation in their android settings. "sensor" ignores the user rotation setting unfortunately. https://developer.android.com/guide/topics/manifest/activity-element

This should go in a new issue, this one has been closed during Godot 3.1 development.

Was this page helpful?
0 / 5 - 0 ratings