Problems with Game Panel?

Hello All,

I am having problem with the scaling of the canvas. And I cant figure out what I am doing wrong!

This is a screen shot of what I am getting and am a loss at what to do to rectify it! I am beginning to think that perhaps I should go find some grass textures and build the game windows with those and vertex snap them together - at least I would fill the window up correctly. Any assistance would be greatly appreciated.

And here is the view in game showing the huge amount of area of Blue background as the canvas is nowhere near the borders of the Game Window.

Thankyou and Regards,
Vaughan.

HI Vaughan,

In your Game view you’ll note that at the top you have aspect ratio set to 4:3;

image

…this is depicted by the blue area you can see, the background colour of the camera, which is filling the space which your canvas (ratio of 16:9) is not taking up.

Change your Game view aspect to 16:9, if you don’t have an option for this you can create one at the bottom by clicking on the add icon (plus in a circle). You will be presented with this little dialog window in which you can specify your settings;

image

Looking at your canvas settings, there are some differences also for the position and the Event Camera, however it may be that these come up later in the course. The could be true of your Main Camera, but obviously I can’t tell without the screenshot.

Hope this helps :slight_smile:

Hello Rob,

Long time no see :sunglasses:. I have been away for quite some time. Only recently been able to get back into it.

The thing is with the 16:9 view there is more of the infamous blue backgound :frowning:. Shown thusly:

In the image there are two sprite textures which i am seriously thinking of using to set up the playboard in a more conventional manner. But I don’t know whether that will stuff up the rest of the lectures!?!

The Camera setting are shown in this image - although I should mention that I haven’t gotten to the lecture on the Cam’s yet:

I am ‘trying’ to figure out what the problems are, and or what the next move should be. I am using 5.6.f1 so that might account for all the problems or more likely, something I’ve stuffed up or missed.

Cheers,
Vaughan.

Hi Vaughan,

Nice to hear from you.

Try changing your camera Size from 5 to 3.375.

Well, that worked a treat! :sunglasses:.

I have no idea why but I suppose that might be coming up in the next lecture(s). I can’t say I truly understand everything that we are doing. But at least I now know how to work out ratios using cross multiplication - so, it wasn’t a total waste :stuck_out_tongue:.

1 Like

It’s been quite a while since I looked at Glitch Garden lectures, so I was merely comparing your settings to the ones in the completed project I have at this end, the only downside of that approach is that it is easy to include stuff that you may not have got to yet. I’d have thought this may have already been covered as it is effectively to do with the playspace, but can’t be 100% certain.

You can, of course, just download the project “as it was” from the end of the previous lecture(s) by using the GitHub links. I recall we talked about Git before, but if you’re not massively comfortable with it yet you can just use the download link. Just make sure you put the extracted files into a separate folder so that you have the “course version” and “your version” separately. That way you can compare settings more easily between the two - hand to see if things like the above were already covered or not.

Regarding the grass sprites I saw you mentioned, I would continue with the course “as is” for now if I were you. There are some bits and pieces that cover the mouse click detection for placing defenders and so on which may cause you some other minor headaches if you stray too far from the path. You could of course come back afterwards and see if you could improve the background yourself.

From memory, even by following all of the settings and course details I never got the squares of the grass to align “perfectly” with grid in Unity, it wasn’t really a big issue thought. You will find a few other quirks (read: features) from this game that you may enjoy fixing/enhancing more as you come to them - enjoy! :slight_smile:


Updated Sat Apr 07 2018 15:35

Just for reference, in case you want to go back and take a look;

  • 16:9 Game view - Lecture 133 “Scaling and Aspect Ratios” @06:53 (just before and just after)
  • Grass Scaling - Lecture 137 “Scaling Level Backgrounds” @04:41 (onwards) - note the UV Rect for the grass image
  • The 3.375 value - Lecture 145 “World Space UI Canvas” from the beginning, there’s a slide which shows the maths for the aspect ratios and minimum requires columns/rows at 4:3 - this is where you see that value for the first time.
  • Making the grass squares “square” @02:42 - note the value 6.75 for “grass squares tall”
  • UV Rect height value of 3.375 explained @04:16

And to answer the question you had about why it works, your camera is set in orthographic view, so the size is set at half of height, thus 6.75 (world units) / 2 = 3.375 - this is covered @12:08

Hope the above is useful for a little review :slight_smile:

Note - I spotted that your camera location wasn’t set at 5,3,-10. The event camera being set is also covered in the above lecture.

1 Like

Yes, that is a really good list for review. It’s slowly starting to come together now. When I have finished the game I will try and redo it using the above for reference for design and doing some things my own way, just to see if I really understand it.

Thanks again :sunglasses:.

1 Like

You’re more than welcome Vaughan :slight_smile:

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

Privacy & Terms