Canvas scale problem

More of a misunderstanding than a problem
At aspect ratio 16:10 i have UI panel taking up exactly half of the screen, as intended (Cube is at center)


But if aspect ratio goes for example to 5:4, panel takes more than a half by horizontal and less than intended by vertical
Canvas and Canvas Scaler settings:
I’m pretty sure i am just using Canvas Scaler wrong. How do i have half the screen constantly black regardless of aspect ratio?
Thanks. (Sorry if bad English)

Use the anchors of the panel to stretch to half the width of the canvas. It would be something like Min: 0, 0. Max: 0.5, 1.

You can read more about anchors on the page UI Overview > Basic Layout: Redirecting to latest version of com.unity.ugui

4 Likes

Anchors worked, many thanks!