Problem with sprite scaling

I’ve run into a problem with my canvas scaling during the 48. Export and Import Package part. I’ve set my canvas to 1440x1080, but when I drag in the Blue Rocket Background sprite it appears tiny. I’ve compared the canvas settings against what appears in the tutorial, they seem to be identical, with the exception of the scale for the Rect Transform of the canvas which is about 0.3 (I can’t seem to change this though).

I can stretch the background to make it fit, but that doesn’t seem right. It is 1440 wide, 100 pixels per unit, and my canvas is 1440 wide 100 pixels per unit. In the course, the sprite appears the right size when it drops in, so something must be wrong with my setup.

Unity 2019.3.5f1

Hmmm. I seem to have fixed it. I created a new aspect ratio of 1440 x 1080 in the game window and selected that. Didn’t change anything. Closed and reopened. Now the sprite drops in at the right size. Selected 4:3 as in the course and everything is still okay. None of the canvas settings have changed so I don’t know what gives.

A post was split to a new topic: Problem with sprite

Hi SteveBee,

Welcome to our community! :slight_smile:

Please share more information on your problem, for example, a screenshot. Which sprite “drops in at the right size”?

Hi Nina,
The screen shots would look pretty much like Lawrence_Leo’s above. All sprites are affected. I’ve got a little further though now. This issue appears to be the difference in the size of the canvas compared with the camera. See the image below. If I zoom in on the camera, the sizing of the sprites relative to the camera look correct when I drop them in and the course works. If I’m zoomed out looking at the canvas, which I was, the sprites look tiny when I drop them in.

I’m assuming that the canvas size is in screen units but the camera is in world units, so is relatively tiny. I’m working okay now, but it seems strange that the canvas/camera aren’t set up so the canvas and camera overlay correctly.

Admittedly, the different sizes of the Canvas box and the camera box are confusing but this is how Unity works. If you are in doubt whether you placed everything correctly, check the game window. If your game looks correct there, you did everything right.

UI elements like Button, Text and Image must be parented to the Canvas and located inside the Canvas box.

Non-UI elements like SpriteRenderer must not be parented to a Canvas. To be rendered, they must be located in front of a camera within the camera viewport box.

Thanks. All sorted.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms