Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question UI not working for 16:9 but working for 18:9? 2022.3.4f1

Discussion in 'Editor & General Support' started by alexsteam4, Jul 20, 2023.

  1. alexsteam4

    alexsteam4

    Joined:
    Sep 11, 2021
    Posts:
    3
    I m making a mobile game and i was working on 16:9 aspect ratio. On the scene tab it looks fine as it was but on the game tab UI Text and Buttons disappeared. If i change the aspect too 18:9 it looks fine, the buttons
    reappear and it looks okey. Why? It worked fine for 16:9 before and i never used the 18:9.
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    With free aspect ratio you can see how the buttons move when the ratio and resolution is changed.
    Probably a bad canvas setup with the anchors
     
    alexsteam4 likes this.
  3. alexsteam4

    alexsteam4

    Joined:
    Sep 11, 2021
    Posts:
    3
    Is there anyway too fix it? I just can t find the solution? I don t get it how in 18:9 works and on 16:9 everything dissaper
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563
    Yes, but apparently you didn't read it above. I'll repost it for you:

    Go fix it.

    Here are some notes on UI Anchoring, Scaling, CanvasScaler, etc:

    https://forum.unity.com/threads/inc...size-between-two-people.1130146/#post-7261747

    https://forum.unity.com/threads/game-ui-button-size-problem.1142650/#post-7337383

    Usually you need to choose a suitable ScaleMode and MatchMode in the Canvas Scaler and stick with it 100%. Generally if you change those settings you will often need to redo your UI entirely.

    I also use this
    CanvasScalerOrientationDriver
    utility to make sharing UI for Landscape / Portrait easier. Read what it does carefully.

    https://gist.github.com/kurtdekker/8802b1b6c708637398f8c9167641efd3
     
    DevDunk likes this.