Black bars at sides of game

I just updated my game from 4.7 to 5.6.4f1 and am having problems with black vertical bars appearing at the sides of the game (for Windows). I have “start in native resolution” selected in the player settings.

Any idea why this is happening?

How to reproduce

  • In player settings. Select resizable window.
  • Build game. Resize window to square. Alt+Enter to go to full screen. (See bars). Exit game.
  • Deselect resizable window. Select “start on full screen”. Select “start in native resolution”.
  • Build game. Still see bars.

Conclusion. It seems to be remembering the size of the window from when it was resized.

Any work around for this??? e.g. a script that will work on Unity 5.6 that will detect if you are in fullscreen mode and set the correct resolution?

Seems there’s a bug in Unity 5.6 where Screen.currentResolution.width gives the same value as Screen.width on Windows. It seems to be OK on Mac though.

This is why you should never upgrade!

1 Like

I found a solution I can just use Display.main.systemWidth

Should do the trick I think. I hope thats the same. Does it depend on if they run the game on their main display?

2 Likes