Hello I have a UI element that I want to take up the left hand side of the screen. No matter the aspect ratio or screen size, I want this element to cover 50% of the width and 100% of the height. How can I achieve this?
I setup my rect transform as follows and it looked great!
But then I expanded my editor window and everything was ruined. The anchors stayed where they should, but the rect transform scaled to no longer keep their points.
Here are the official docs on how to make your UI handle various resolutions and aspect ratios cleanly:
Here are some notes on UI Anchoring, Scaling, CanvasScaler, etc:
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.
ah, right! I always hated that in ugui, but there might be a good reason for it to be this way.
also, consider using a layout group with a single layout element and play with the Flexible Width/Height properties (you can set them as 0.5 or whatever) if you want a more declarative approach instead of manually moving them