- Home /
aspect ratio vs fixed resolution [HELP PLEASE]
Hi, I would like to know the difference between both?
I am using transform.translate(speed*time.deltatime, 0f,0f) on a cloud to move it in canvas. I've set the speed to 10f; In the Editor view When i use the aspect ratio (i.e 16:9) the cloud moves fast. but when i use the fixed resolution to (i.e 1920*1080), which is 16:9, the cloud moves very slow.
Why is that happening? am i missing something?
This is because the canvas changes size to fit the window. (Select the canvas when you are switching back and forth to see this). Selecting aspect ratio in your game view will make the game the size of your current game view window (while maintaining the correct ratio). If you select fixed, it will scale itself to fit that amount into your window (basically you are zoo$$anonymous$$g out). The cloud moves at the same speed, but in the fixed it just appears to move slower due to having a zoomed out look to it.
@Ymrasu So its alright? I am just being a little paranoid right?so you are saying i should work in my reference resolution, 1080*1920, (in fixed) rather than my Desired Default aspect ratio, 16:9.
Yes its alright. If you plan to not let the user resize their game window you can work in the fixed resolution. But if you want them to be able to resize, working in just aspect ratio will allow you to see how your game runs at varying sizes.
Answer by Casiell · Mar 04, 2019 at 08:22 PM
Aspect ratio is a ratio of screen width to screen height. This include all resolutions where width/height = 16/9.
1920*1080 is just one of (infinitely many) resolutions that fit into that ratio.
Selecting 16:9 in your game view creates a game view with largest possible resolution that would fit into your game view window size without any scaling.
Selecting 1920*1080 in your game view creates a window of exactly this size and scales it down so it fits your game view. There is a scale slider where you can see a factor by which it was scaled.
Your object speed does not change, it is always the same, it's just on lower resolution it takes less time to go through your window because there is less pixels to traverse.
Depending on your target outcome you may want to factor resolution (not aspect ratio!) into your speed calculations so it always takes the same time to go from one edge of the screen to the other.
Thankyou for your prompt reply :)
so you are saying I'm good?? Dont need to worry about these?
Answer by Natrad · Mar 20, 2019 at 09:28 AM
Hi @WirealTalha
Hi there, the same for me. After looking around on the internet about 2 hours :(. Watching a lot of tutorials video. Finally I found the full tutorial that solve this issue. Tested and it worked for me.
Hoping that will help you. Link: https://youtu.be/2uYkom__5zo
Key point: DO NOT CHANGE THE Camera's projection SIZE if you want the velocity is the same at any device. Instead of that, Scale your game as the way of above tutorial. Good luck.