- Home /
Is there a way to keep camera and UI always the same?
Right now I have a script to make it so the camera is always 16:9 aspect ratio. But now the canvas UI is outside of the content. Which has a weird effect, where the UI is rendered but when it's removed the image is still there, but only outside of the camera area. Is there not a good way to just put all of the content in a scene so it's 16:9 and always inside of the screen? Imagine you were watching a movie with unity. You want everyone to see the same exact thing, and if the screen is not 16:9, then just put black bars on the sides or top and bottom (not literally, but resize the game and keep everything visible). Right now if I start the game without doing anything to the camera, in for example 1280x800 resolution, it expands the game so there are no black bars, but then content on the sides is lost. How do I fix this?
This is what I'm trying to achieve:
Answer by DaresFireson · May 10, 2019 at 07:17 AM
In the canvas scaler options change "Constant pixel size" to "Scale with screen size" and it will fit the screen on any resolution
Your answer
![](https://koobas.hobune.stream/wayback/20220612201042im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Developing on multiple resolutions 1 Answer
Mobile Development screen resolution and aspect ration 1 Answer