Searched for it and found pretty complex answers, and they were also from older versions of Unity but I don’t think the problem is there. Seems I do not understand the ratio scaling and the way it fills the margins and I also have a shallow understanding of the anchors.
Is there any quik solution to this? Or I should not bother with this since the build has the option to select a resolution.
If you put a square on your screen, you expect it to be a square no matter what type of screen you play on. So instead of stretching the image one way or another, Unity crops the image by default. The rule is: Top to bottom stays the same (if your square takes up one half of the game’s height, if stays that way no matter what), and the left and right borders of the game screen are moved to crop or expand the image.
That’s how the scene is rendered, anyway. Canvases are a different story, as the canvas has a canvas scaler component that allows you to define custom rules for how your UI is scaled.
You now have to decide whether that makes sense or if you want to do something about it. Having a game that perfectly fits into any screen is not feasible, unless you’re okay with the cost of either having completely different gameplay experiences on different screens since the objects moved somewhere else, or alternatively stretching your image, in which case a circle would become ellipsoid depending on your aspect ratio.
The usual way to go about this is to develop for one ratio and work with margins for all others. If the screen width (in relation to height) is larger than the reference resolution’s, you can fill left and right with blank, black pixels or maybe some kind of background, and if it’s smaller, you need to zoom out the camera until the game space’s width fits into screen, which leaves you with margins at the top and bottom that you could fill.