Announcement

Collapse
No announcement yet.

Black screen when rotating device

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Black screen when rotating device

    Hey guys,

    trying to write a little Android game and started using the puzzle template from UE. I found the setting to change the APK Packaging Orientation and set it to "Sensor" in the Project Settings. The idea is that the app starts in the orientation the user is holding the device in, either Landscape or Portrait. So far so good. However, when I hold the phone in Portrait mode I only see a black screen. When I rotate the phone to landscape the game screen appears. Rotating back to portrait turns the screen back to black. What could be going on here? I'd love to figure out how to not get that black screen when I rotate the device to Portrait mode.
    I uploaded a video of how this behaves if you follow the link here: https://drive.google.com/file/d/1-8i...ew?usp=sharing
    Open for feedback!

    -B

    #2
    So this is reproducible with a a blank project packaged for Android. The moment one turns the phone to portrait it goes to a black screen. My best guess right now is that the orientation change event from Android resets the screen setup and something fails due to the new screen dimensions. Turning it back to Landscape brings the level back into view.

    But what event could I be listening to when Android changes the orientation? And what part of the code would need to get added to resolve this problem?

    Also not sure if this is a problem specific to my Samsung Galaxy Note 8 or a generic Android issue since I don't have any other Android devices at hand that work. My old GN5 refuses to even load the app failing immediately when trying to open it. Probably too old of an Android version.

    Comment


      #3
      OK so I resolved the fact that the screen remains black by changing the camera aspect ratio to 0.5625 (9:16). So that means the trick is to change the camera aspect ratio when the orientation change event happens.

      So now the question remains what is the event I can trigger on for the Orientation change coming from Android? I don't see anything in the APIs or documentation from Unreal Engine that talks about that. Any help or pointer is appreciated!

      Comment

      Working...
      X