Hello, I tried this on Godot 3.5.2 stable

  • I added '$Label.text = str(OS.screen_orientation)' in _process function

  • I set my Android phone to allow orientation detection.

  • I export the game.

  • I ran the game then I move the phone to landscape orientation.

The label always prints "1". I expected the value to change.

I just need to detect the real device orientation so my game can adapt.
Is my method wrong ?

When I set OS.screen_orientation to 6 the game display is rotated automatically, it doesn't relies to the game code
I can detect the current orientation by getting the window_size. If the x is bigger than y it is on landscape mode.