Canvas broken after loading project on 2022.3.3f1

When I try to edit UI right after loading my project, canvas size (which is set to scale with screen size by height to 1920x1080) is incorrect. But when I click on the "Game" tab, it fixes itself, and every other canvas in project, even outside of currently loaded scene. Tested with project upgraded from 2022.2.5f1 and on a new project created on 2022.3.3f1. I haven't noticed that behaviour on the older version.

9104059--1262032--upload_2023-6-25_20-0-44.png

6 Likes

I've also been having a number of new issues with the canvas in this Unity version that didn't exist prior. All of my POS Y values are resetting to zero on prefabs

7 Likes

Got the same issue today after upgrading from a 2021 LTS. Very weird.

We also upgraded to 2022.3.3f1 and now canvases act differently when starting up the same built exe multiple times. Sometimes the canvases are scaled half out of the screen, sometimes everything fits perfectly, and sometimes the canvases can not be seen at all and have to be way off-screen. All happening on the same built xD We have similar issues with a newly created project on 2022.3.3f1 and a single Canvas (Graphy) in the project. Its a mess...

3 Likes

Feel free to vote on this issue (its related, but the description dont convey the whole story) https://issuetracker.unity3d.com/issues/2022-dot-3-some-canvas-rect-transform-values-are-shown-as-scientific-notation-numbers-when-adding-a-canvas

Banged my head trying to figure why it was not working, looks like it's a new problem...

When testing this in a new project :
- I set the Pos Y of an image to -90.
- Close and re-open the project
- The pos Y value displayed in the inspector is now 0, event if the value saved in the scene file is still -90...

3 Likes

Thank you very much for this.

Will avoid updating until this is resolved. Heavy user of Canvases.

I sent a report of this problem to Unity… hopefully they accept it and this gets fixed because this is causing my UI to get messed up

Here's a quick workaround for now while we wait for Unity devs to fix this... Thank me later...

using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine.SceneManagement;

namespace c0nd3v
{
    public static class FixCanvas
    {
        [InitializeOnLoadMethod]
        public static void InitializeOnLoad()
        {
            EditorApplication.update += Update1;
        }

        public static void Update1()
        {
            // 1. Open game view
            var gameView = EditorWindow.GetWindow(typeof(EditorWindow).Assembly.GetType("UnityEditor.GameView"));

            EditorApplication.update -= Update1;
            EditorApplication.update += Update2;
        }

        public static void Update2()
        {
            // 2. Open scene view
            var sceneView = EditorWindow.GetWindow(typeof(SceneView));

            // 3. Reload scene
            var scene = SceneManager.GetActiveScene();
            EditorSceneManager.OpenScene(scene.path);

            EditorApplication.update -= Update2;
        }
    }
}
3 Likes

I can also confirm that it's a bug. After I opened my project today, all values on my buttons on canvas were set to 0...

1 Like

Everyone go upvote this issue so it gets fixed!!!

https://issuetracker.unity3d.com/issues/recttransform-pos-y-is-not-loaded-when-opening-the-project-slash-player

1 Like

I am in 2022.3.4 and my canvases are working perfectly except in game builds, where several canvases have their x values reset to 0 every time. I've also upvoted the issue, everyone do the same!

1 Like

More votes won’t make the months pass faster.

1 Like

Users voting on such a blatant issue is such a lame cop-out by Unity staff. That crap should not have left the door, it should have been caught by regression testing and flagged as a showstopper for release.

7 Likes

Also experiencing broken canvas problems using both 2022.3.3f1 and 2022.3.4f1…some UI elements randomly changing their vertical position on the screen in the game window. Overall scaling in the game window also seems to “zoom” in (and cut off top of the game window) even when set to the default scale of 1.

Very disappointing to see a project breaking bug like this in two consecutive LTS versions! Have had to revert to 2022.3.2f1 as workaround for now… please fix ASAP!

1 Like

Yep, just upgraded from 2022.3.0 to 2022.3.4 and my canvases break. It is particularly bad because while switching to game view does rescale them, if they had anchors that got messed up when the canvas loaded with broken size, they stay broken even when correctly rescaled back to normal dimensions.

Just tested in a fresh project. It happens immediately with the canvas.
Place new canvas in screen, place images anchored at each corner with offset y values.
Select scene view, save project, close unity.
Restart Unity. The canvas will now be broken.
Click game view, canvas dimensions load, but now all your anchored objects will be reset to y = 0,

3 Likes

This is on an LTS release. Stuff like this should not be happening.

6 Likes

But they are and they have and they will.

1 Like

Same problem with 2022.3.4 "LTS" :/

Same issue.