Camera is Tiny, or Canvas is Huge...?

I’m having a strange issue here. The size of my camera is extremely tiny, and scaling it up to the size of the canvas makes the dimensions pretty unwieldy… As far as I know, my settings for the canvas and camera are the same as Rick’s. Any information on how to troubleshoot this?

EDIT: It looks like the size of my workspace grid is pretty different from Rick’s… but I really don’t know why or how to change that.

1 Like

That’s actually working correctly, nothing to worry about.

To get things clear, a canvas gets the size depending on your resolution but it’s still measured in Unity units, so, if your resolution is set to 1920x1080 that will be the size of the canvas, making it huge compared not just to your camera but to everything in your scene like in the next image:

As you can see there, the size of the canvas is super big compared to anything in my scene, that’s normal.

If this bother you for some reason, what you can do is set your Canvas’ Render Mode to Screen Space - Camera.

Then set your Render Camera to your current main camera, you’ll see that the canvas will always be the same size as your camera, this has it’s own issues, but nothing to need to worry about in this project, with time you’ll found out what setting suits best for each project.

3 Likes

First off, thanks for the quick reply!

I think I’m starting to understand what’s happening, but does this mean that Rick is using some awfully small resolution on his computer? I resized my fonts to his (36) and even that font size totally overwhelms camera size “6” he instructs you to set it to. It’s a bit confusing, to be honest, as I thought I’d be at least getting somewhere by squaring up our font sizes…

Anyway, to try and follow along as best I can with the lesson, I’m trying your instructions on sizing the camera to the canvas, but under “Render Camera” I have no option to select Main Camera. There are simply no options. Not a huge deal, I suppose, as I just wanted to make sure I could still complete the lesson not having my camera line up nicely in frame with my background image like Rick did.

1 Like

I see what is going on here, I’m really sorry, I just thought you were on a different lecture.

Rick is not setting the background image on the canvas, that’s why his background image is so small. Of course, you could set it to the canvas if you’d like, but that means the background image will change its size depending on the resolution and image setting.

1 Like

Hi Earl,

I’m just here to confirm what @Yee wrote: The canvas in Unity is usually very large compared to the “little” camera viewport. Only UI-elements such as Image and Text may be parented to the canvas. They also must be arranged within the canvas box. They do not need to be seen by a camera to get rendered.

Everything else such as Renderer components must be located in front of the camera to get rendered. Rick uses a SpriteRenderer for his background, thus the background needs to be in front of the camera, not inside the canvas.


5 Likes

Thanks you guys for the responses!

I think I’m understanding what goes on here. I can put the image in the canvas and it also shows up in the game screen… as I’ve been doing for text adventures and such, so that little bit still mystifies me. But for sprites and images normally too small for a canvas, you would put them in front of the camera?

Also, since the camera takes up a bit of real estate on the canvas, what happens to elements you put on the canvas that overlap…? It’s all a bit befuddling to get used to at first, there being a canvas space AND a camera space, and both get seen by the camera in their entirety. But this could just be over-analyzing.

Put Renderer components such as SpriteRenderer in front of your camera because they are non-UI elements.

The Image component is a UI element, thus is must be inside the Canvas.

This doesn’t have anything to do with the size of your sprites because, as you can see in the game window, the canvas adjusts itself to the screen size, and the images look normal even though you didn’t shrink them in the giant canvas box.

I would suggest not to worry too much about the differences. Keep the game window open or check it on a regular basis to see how your game will eventually look. Try to realise your ideas work. You’ll automatically figure out what works best.


See also:

4 Likes

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

Privacy & Terms