Hi,
How are you?
there is a problem with the game when I have built it, it doesn’t show or play as it should be:
as you can see the player is out of the game’s boundaries and also the score, and you can see everything else is showing from outside the game, plus it doesn’t show the health number.
in unity editor it works perfectly if the game isn’t full screen, however, if I started it in full screen, it’s alsmost the same as what’s in the picture.
This happens because in Unity you have set the Game view to have an aspect ratio of 9:16, but in your build settings your resolution is a different ratio. The rest of the space gets filled with the background colour of the camera (the blue) and the canvas is applied over the available screen area, so your UI GameObjects (score etc) are still anchored to the corners, but are now more stretched out.
Goto Build Settings / Player Settings and then expand the Resolution and Presentation section;
Change the default canvas width/height to something with the correct aspect ratio, based on the above screenshot, for a height of 600, you’d want a width of 337.5, which is 600 / 9 = 37.5, 37.5 * 16 = 600
I was able to use Scale with Screen Size and set it to “Height” to get everything to stay in place without having to lock the resolution settings (600 looked VERY small on my screen) but now the camera changes size in full screen and that’s causing the player’s movement padding to change. Is there an easy way to stop the player from breaking through the sides?
I tried adding a box collider with a ridgidbody but the player went right through it.