Cant resize object by the coordinates

Hi! I have some problem with my game. I need to place squares in screen area like a grid, thats why i get the screen width, for example, then i convet it to coordinates (left side x equals -2.34 and right 2.34) then divide it (2.342) into some parts (for example 2.342/5 - five squares in line) and then i try to change the scale of squares in code, but here i have a problem, because, as i understand, coordinate units doesnt equals scale units and objects become larger or smaller than i want , and i cant scale objects as i want.

At the picture i tru to do square with width equals to width of screen width (which i converted and get width like 2.34*2 in coordinates)

I don’t really understand what you’re trying to achieve here.

The scale is just a float to indicate how much bigger (or smaller) it should be.

Are you working on a UICanvas? Or in Worldspace?

If you’re working on a UICanvas, you might need to use the Reference Pixels per unit

If you’re working in Worldspace, you might need the camera details in your calculations.

Basic answer: try ChatGPT to come with an algorithm.