-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OS.get_screen_orientation() returns LANDSCAPE, although project is set to PORTRAIT on android. #17109
Comments
@footurist Does this still happen with Godot 3.1? Which version of Android and which device? |
Still happens in 3.1 stable. Tested on Xiaomi Redmi Note 4 with Android 7. |
I just ran into something like this - my setup is Godot 3.2 deploying to an Android 10 device. If I set Project display mobile orientation to 'SENSOR' I can deploy and the game will 'rotate' as I turn the phone (as I'd expect) however OS.screen_orientation is ALWAYS 0 - which is clearly wrong. Update: if I set 'PORTRAIT' it's still 0 - 'LANDSCAPE' it's STILL 0 - e.g. all it ever returns is 0 which is nonsense. Furthermore - I'd suggest this should return the actual orientation of the phone - not the game. Reason: I'd like to lock my game into LANDSCAPE but adjust it's UI depending on how the user is holding the device - works for me but can't be done as-is? |
Confirmed here, using 3.2.3 stable and Samsung note 9 Export Settings: OS.get_screen_orientation() is always 0, even though the app is switching orientations based on phone orientation. Also switches orientation regardless of the phone's Android OS Lock Rotation setting being on or off |
@m4gr3d FYI, the There's no way currently to provide information about an issue being fixed both in 4.0 and in a 3.2.x release via a cherry-pick. In this case we just set the milestone of the first branch where it's fixed from the start (4.0). |
Is this fixed or going to be fixed ? I'm using 3.2.3 and still have the same issue OS.get_screen_orientation() return the same value (0). |
@m4gr3d Hopefully, just checked the changelog for Godot 3.2.4 beta 1, there is no mention of it :( |
@anisc That pull request was merged after 3.2.4beta1 was released. It will be present in 3.2.4beta2. |
I'm getting OS.get_screen_orientation() returning the value (0) in 3.4.2.stable. Am I missing something? |
Well, did you change the orientation? :P |
Sure enough, it just spits out what you have set in the project settings. Thank you for clarifying @KoBeWi |
I guess this should be labeled as a documentation fix? |
I'd open a new issue. |
Did someone open a new issue? I can't find it and the "issue" of The problem I'm facing is having to deal with notches and whatnot, so the game fits the screen properly. Having a function to detect the current orientation would be very helpful, in conjunction with |
Both Project>Export>Screen>Orientation and Project>Project Settings>General>Handheld>Orientation are set to Portrait and when I call the above function on device it always returns 0, which stands for Landscape. Is the bug from Godot 1 somehow back or am I missing something?
The text was updated successfully, but these errors were encountered: