UNITY2D How can I ensure that everything is visible within the camera?

34 Views Asked by At

Right so, I'm working on a 2D platformer as a complete beginner, but have ran into an issue. When I run the game in unity, everything is visible as intended, but when I build it and run it on my PC, it is slightly zoomed in, causing the character to not be visible at the start, as the character spawns on a platform very left of the screen.

If anyone knows a solution it'd be greatly appreciated :)

1

There are 1 best solutions below

0
spacemann On

What's probably happening is that the resolution of your build is native, while the resolution of your play window is something arbitrary.

You can fix this by changing your editor resolution to something closer to your build by clicking on the button in your game window between [Display 1] and [Scale] that probably says something like "Free Aspect" on it and switching to your native resolution (or whatever your build is set to).

enter image description here

if selecting native there doesn't work, check what your build is set to in Project Settings > Player > Resolution and Presentation. Then set your play window to match those settings. (or visa versa, if you want a custom resolution/aspect ratio)

enter image description here.