I was looking for tutorials and examples but I still have some specific doubts:
I understand that the resolution is changed with “SetResolution” and this works for me. Since the HUD that I have designed inside the “Canvas” is perfectly rescaling. But what about different resolutions and aspect ratios? Should I only allow resolutions with a 16: 9 aspect ratio? Does anyone with a resolution of 1920x1080 will see more of the scene than someone with a lower resolution?
I think the information I lack about this is very basic. I apologize if the question is very silly. But thank you very much for answering me
Thank you very much for reading and answering. Greetings
Hi DroidifyDevs, thanks you for your quick answer!
I think I forget one important detail. My project is 2D, I use sprites. Do I have to put GameObjects having sprites (player, enemies, etc) within the canvas and let the canvas automatically rescale all?
PD: To change the resolution I do this, with a button and a dropdown, and a text debug:
But something goes wrong. Since I have to press the button twice. Because the first time only modifies the resolution. And the second time I press it changes the text and objects that are not part of the HUD.
Mmmh. The typical thing is that games allow you to choose the video settings from within the game, or not? I was doing it just for that reason.
But equally, do not I have to change the size of the camera depending on the resolution chosen?
Sorry for all the doubts. But it is a subject that never investigates in any other motor
Again, you can see the answers to most of your questions with the image I showed you. Play around with the game view resolution and see if you need to change anything. Unity automatically changes the camera for you, however this may lead to unexpected game views so check many resolutions. As you see I’ve made a bunch of mobile device resolutions so I can see what my game looks like on an iPad Pro or a Samsung S7 or a cheap BLU Advance.
Usually games have resolution settings for performance reasons only. If someone has a terrible computer, they might want to run at 480 or 720p. You should always design the game to fit your target resolutions, as most people play full-screen 1080p or even 4K.
Yes, I think I understood. Thank you very much for all your information. I guess I’ll have to do the game in 16: 9 and then see how it will look in different resolutions. I would like to give the performance option to the user. Do you have any idea why my code works incorrectly? As I say, the first time I press the button, the resolution is changed, and I have to press it once again to change the objects that are not part of the canvas and the text where I show in what resolution is.