Health and Score displays in Editor but not in full screen

The Health and Score displays well in the Editor test mode.


But not when I play in full screen

I think it’s because the Main Camera is way in the bottom left corner of the screen when the Game Canvas with the score and health text are way at the top.

What should I do? My player is supposed to be able to play in any device with 9:16 aspect ratio.

You have a null reference exception check that you have set all references in the inspector

Ok… I will try to resolve the error…was error free before I tweak stuff. I also tried to build a PC version and the canvas text was way too big and my player ship goes out of boundaries. Was fine in Editor test. I think this is related to score text display out of scene.

There isn’t any more null reference error now. I tried tweaking the Game Canvas > Canvas Scaler… UI Scale Mode

Current settings, Editor Maximize on Play screen is fine (both health and score) are displayed. But when I build and run it in web browser, it fails to display the text.

The various Canvas are similarly set. Now the Web version looks fine but the PC version is bad.

Health and Score are outside of play area. Effects and ships move out of the background bounderies.

Here’s my Player Settings for Resolution

try setting your anchor points


check your scale in game scene

Game editor runtime scale is 1x.

I think I got the anchor points set. I tried to set to Top left for Health and Top Right for Score.

May I know the rational of camera angle so small on a canvas that’s also so small at the bottom left corner of the screen. Isn’t it easier if things are readable in a proper screen resolution of at least 800x600 and system scales up or down as required for a player’s resolution. This way we don’t have text boxes floating at the top like giants.

lol I don’t know the reason to be honest maybe the documentation might help. It’s kind of weird but it works, I’m sure there is a reason maybe to do with scaling and rescaling or efficiency. Personally not so worried about the why and how for some things yet just trying to get better at coding, sometimes knowing that stuff helps for clarity and sometimes it doesn’t

If all works in any case, then it’s fine. But not when it works great only in Editor runtime but could have issues when build to PC or web.

Currently I changed resolution of project screen and canvas to 450x800 (9:16 ratio) and it works on PC build but still not on Web build. Web build still cuts off the top part on my laptop screen. But when I drag the browser window to my external 24-inch monitor, then the whole screen with the health and score displays well. Runtime in Editor is fine.

What resolution is your laptop’s monitor?

1920x1080 with a 125% scaling for text size, apps, etc. It’s 14inch.

Your screen is 1080 px high but the resolution settings in Unity make your build 1920 high, which is almost 900 px higher than your screen is able to display. Make sure to use a fitting resolution which matches an aspect ratio of 9:16.

Player setting and/or Canvas setting? I have Canvas and Player setting as 450x800 now but still Web version has top truncated. PC is fine.

Now I tweaked my PC desktop setting to 100% instead of 125% and the whole canvas with the display text showed. If I returned to 125% setting, then top gets truncated.

But 125% setting isn’t even what’s recommended by my system (was 150% which is too large for my liking). For laptops, such percentage scaling is common. So even though screen resolution may be 1080 or whatever standard sizes may be, if we use standards like 1080, it can get truncated like mine did. So perhaps it’s better to account for these and not have the vertical height set so near the limits? And let the player change the size of his game window accordingly?

Are we talking about WebGL builds? If so, the builds are more limited than standalone versions as they are played in browsers. Think about your future players. There is a chance that they do not have a large screen, so a lower resolution allows more people to play your game.

Yes WebGL builds. Somehow the same resolution used for PC does not work here. My laptop’s screen magnification settings seemed to affect the display.

Test a lower resolution for the WebGL build.

its already 450x800

Could you upload that build to sharemygame.com?

Privacy & Terms