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

Bug BUG. Canvas UI elements are shifted after unity editor reopen. LTS

Discussion in 'Editor & General Support' started by unity_C3437DF9D9B6783D00AB, Aug 18, 2023.

  1. unity_C3437DF9D9B6783D00AB

    unity_C3437DF9D9B6783D00AB

    Joined:
    May 16, 2023
    Posts:
    1
    Hello community!
    Noticed some annoying bug of unity editor 2022.3.4f1 LTS
    When I run Unity editor on windows and open scene with canvas, all ui corner elements (with corner anchors) are shifted with some offset.

    upload_2023-8-18_16-46-7.png
    But bug is not reproduced on the same Unity editor version on mac
    upload_2023-8-18_16-44-36.png

    Interesting that canvas is prefab, so when I open prefab all ui elements on the right place (Windows)
    upload_2023-8-18_16-46-40.png
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563
    Sometimes UI scenes using lots of layout will get transiently stuck in a weird state, and usually just enabling/disabling the top Canvas GameObject will fix it.

    But more likely it is just incomplete / incorrect anchoring / scaling.

    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
     
  3. Wintermute-

    Wintermute-

    Joined:
    Sep 5, 2017
    Posts:
    53
    Getting the same issue using 2022.3.4f1 LTS. Were you able to fix it?
     
  4. LukeINK

    LukeINK

    Joined:
    Jan 19, 2021
    Posts:
    1
    We are having similar issues after updating from 2021.3.12f1 to 2022.3.8f1.

    All of our canvas prefabs are pretty much busted.
     
    Wintermute- likes this.