Unity shrinks my entire canvas when I create a new Script
Whenever I create a new C# Script, Unity has a chance of shrinking my entire game UI. This happens more often than not. When I hit Ctrl+Z, the UI comes back to normal, but sometimes I need to Ctrl+Z a few times until it does. This doesn't make any sense to me. All I'm doing is creating a new empty script, why is it messing my UI and why does Ctrl+Z solve the problem? This is getting annoying, it's been like this for 3 days now.
I'm working on a mobile educational games project at my job, so basically all the games are entirely UI based, which means the entire game screen is shrunk and the default blue background starts showing behind.
By the way, I'm using Unity 2019.4.1f1
Sometimes Unity shrinks the canvas just for a second and then takes it back to normal. But usually what happens is what I mentioned above.
I have the same problem unity version 2019.4.16f1
Do any numbers change? Like, are the canvas scale factors suddenly much smaller? I'm wondering if nothing bad is actually happening, but Unity is simply deciding to zoom out the editing camera.
No, nothing changes and when I click the game tab or the run button, it returns back to normal. It is just the canvas shape that changes without affecting anything.
Your answer
![](https://koobas.hobune.stream/wayback/20220613014321im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to hide x number of button while the button its doing something.. 0 Answers
Dark UI canvas isssue 0 Answers
Problems with Canvas and ui elements scaling at runtime 0 Answers
Updated with UI text element not correct (same frame) 0 Answers
How to remove flashing screen when changing Canvas Render Modes 0 Answers