Recttransform keeps changing when I test or play game
In my program, I have my display set up in an empty object called 'display'. In that object I have another empty one called Menu. In that, I have a Back Panel object (which is literally the backpanel to all my menus) which contains all the menu content as children. So the hierarchy would look like this:
Display Menu Back Panel Organization Menu Mission Menu etc...
For some reason, every time I set the recttransform for Mission Menu to something I want, it changes to something else when I play or test my game (note, it is always the same, yet unwanted, number that it changes to). Then, I deleted the object and all its content (the mission menu and its children) and remade it. Same thing. Then, I RENAMED Mission Menu to Missions Menu and suddenly it worked! I even went into my scripts and retargeted the Missions Menu where needed. I have no idea why this suddenly worked.
Any idea why this is? It really pissed me off for the better of two hours.
I have this exact same problem, although rena$$anonymous$$g the object isn't fixing it. Does anyone else have a fix for this? I've tried remaking the object, rena$$anonymous$$g it, etc. but it still reverts the rect transform to some wierd values.
I want it center/center at 0,0, but it keeps going to bottom left anchors and posX=385.5, posy=254.
This happened when I went from Unity 5.3.4f to 5.4.?
Answer by oliran · Sep 22, 2016 at 12:10 AM
Also same problem here. Rect Transform changes when I hit play, and the change remains even after I stop. Happened when I had a canvas inside another canvas. Started when I upgraded to 5.4.1. Haven't found a fix yet...
@oliran If this is related to rect transforms with Canvas components, there is a temporary fix. I can't find the post that this was discussed in, but here is a solution that works for me.
Remove and Re-Add these components from your UI object (if they exist): 1) Canvas Renderer 2) Canvas Scalar 3) Graphic Raycaster
After that you can make your adjustments to your rect and re-run and cross your fingers.
This may be the issue tracker: https://issuetracker.unity3d.com/issues/canvas-inside-canvas-resets-position-slash-anchors-when-entering-play-mode
Looking for the post in the forums now.
UPDATE: Here is the link in the forums: http://forum.unity3d.com/threads/nested-canvases-do-not-save-anchoring-settings.297518/