- Home /
Canvas rectTransform randomly resetting in the Editor
Hello people,
I'm getting crazy over here. I updated recently to Unity 5.6 and I'm having the worst time with it, getting totally unpredictable behavior with different things but one of the worst is this : I have nested canvases whose rectTransform values are all reset to 0 without me ever touching those! I set them up, everything's fine, I work on a different part of my game, and after a while, seemingly at random, a bunch of my canvases disappear and all of their rectTransform properties are at 0. Their parent canvas is fine and I didn't touch any of those in the meantime...
Does that make any sense to anyone? I'm losing a whole lot of time because of this.
Any suggestions?
Thanks
Answer by Mad4MorKilz · Aug 11, 2019 at 04:31 PM
I’m having the same issue - did you resolve it ? It’s maddening ... @another_kind
Answer by Piyush_Pandey · May 03, 2017 at 11:16 AM
This might be the case when the child canvases are having Anchor Presets set as stretch in their RectTransform component. This will make their width and height as zero but will attain the size of its parent Canvas.
You can change the Anchor presets to non-stretch and assign any size that you want.
Answer by another_kind · May 03, 2017 at 06:27 PM
Yes, the canvas is set to strech (and indeed the left/top/right/bottom are zero) but the scale is 1 and just now again went to 0, even though it's a part I'm not touching at all now.
The settings as I set them:
And the settings I end up with after a while:
It makes absolutely no sense to me. I tried replacing Canvases with Panels as my container for a couple of my objects who had that random bug happening to them and so far, it looks like it fixes it...
That's still some random BS that's making my time with Unity miserable...
Thanks for your answer though!
Your answer
Follow this Question
Related Questions
Canvas shrinks over time 0 Answers
UI Scrollbar in the wrong location 0 Answers
Snap UI Text inside canvas 1 Answer