Search code examples
unity-game-engineunity-ui

Unity UI with different screen sizes


I am making a game and have a problem with UI. I made it to scale with the screen size. In 16:9 it looks as I want to: UI is where I want it to be.

But when I switch to 2160 x 1080 I have a problem. My UI is outside my game screen

I want that my UI on 18:9 stays in the same position as in 16:9. Any solutions to make it stay inside game bounds?


Solution

  • Canvas object -> Canvas Scaler component:

    Scale With Screen Size Match = 0 (0 for vertical app, 1 for landscape)

    And then you need to change anchors for ui objects to align not from borders, but from center.