When you import a picture into Unity and set the type of sprite (i.e. Texture Type = Sprite
), then in the same menu you should also notice the attribute "Pixels To Units".

100 pixels corresponds to 1 unit. Thus, your 128 pixels (if you leave the default settings) should be equal to 1.28 units (Units). This value is different from your 1.06, but this is most likely because your sprite does not have a uniform shape or you have already set Pixels To Units to a different value or you have already changed the scale value of your sprite. Check that these values have not been changed. Put them in our default values.
Further. The size of the "orthographic camera" corresponds to half its height.
In the image below, the orthographic camera will see the area highlighted by the white rectangle. Size (Size) 5 - means 10 units height. The image of the flower is 128px wide and 96px in the height, which has default settings of 1 unit = 100 pixels.

Considering that you want to use the sprite and you need each frame to remain in the upper left corner at any resolution, you can now use the following code, which needs to be attached to the sprite:
void Update () { float camHalfHeight = Camera.main.orthographicSize; float camHalfWidth = Camera.main.aspect * camHalfHeight; Bounds bounds = GetComponent<SpriteRenderer>().bounds; // Устанавливаем новый вектор в верхний левый угол Vector3 topLeftPosition = new Vector3(-camHalfWidth, camHalfHeight, 0) + Camera.main.transform.position; // Устанавливаем смещение на основе размера объекта topLeftPosition += new Vector3(bounds.size.x / 2, -bounds.size.y / 2, 0); transform.position = topLeftPosition; }
In some cases it is possible that the sprite will be slightly higher than the top edge of the camera. Then you can bring the mapping from screen space into world space. In this case, the screen size is determined in pixels. Because in this case, the bottom left of the screen has coordinates (0,0); right top ( pixelWidth , pixelHeight), a position z in world units from the camera, then you need to place the image in the top left corner like this:
void Update () { Bounds bounds = GetComponent<SpriteRenderer>().bounds; Vector3 topLeftPosition = Camera.main.ScreenToWorldPoint (new Vector3 (0, Camera.main.pixelHeight, Camera.main.nearClipPlane)); // Устанавливаем смещение на основе размера объекта topLeftPosition += new Vector3(bounds.size.x / 2, -bounds.size.y / 2, 0); transform.position = topLeftPosition; }
The answer is translated and updated with https://stackoverflow.com/a/22596935/6104996