Getting my head around unity world space and how it relates to screen size.
Unity Unit
The unit of measurement in unity. It is good practice to match 1 unit to 1 meter. Default physics and lighting systems are all tuned to this scale.
Tile mapKeep a scale of 1 tile = 1 unit, just for the sake of simplicity.
Camera
How much of your game is visible depends on:
- Camera size
- Aspect ratio of your platform’s resolution (e.g. monitor, phone, etc)
![](https://paper-attachments.dropbox.com/s_CAF52C2B9096F71F4316BEC80487C2BE2B89BB84A999F36C80AD2D021DA2D0A9_1575527598363_Screen+Shot+2019-12-05+at+11.52.30+am.png)
ExampleIf you want your game’s viewport to include about 10m of your scene vertically (for a 2D game).
Camera size: 5 unitsMy scale: 1 unit = 1 meter
Pixels per Unit (PPU)
This is a property of a unity Sprite. Specifies how many pixels from your Sprite fit into a unit in the scene when the GameObject is scaled 1,1,1.
![](https://paper-attachments.dropbox.com/s_CAF52C2B9096F71F4316BEC80487C2BE2B89BB84A999F36C80AD2D021DA2D0A9_1575507843863_Screen+Shot+2019-12-05+at+12.02.46+pm.png)
Setting the right combinations
If you want to make sure all the sprites are the right size relative to each other and the same ‘sharpness’ no matter how far in/out you are zoomed, you should adhere to a consistent unit of measurement for your world.
If you want to make sure images are sharp on a particular resolution, you need to make sure you have the right combination of these:
- Object height
- PPU
- Camera size.
Example
- Character height of 1.6m
- Camera view height of 10m
- Supporting resolution 2436 x 1125px
![](https://paper-attachments.dropbox.com/s_CAF52C2B9096F71F4316BEC80487C2BE2B89BB84A999F36C80AD2D021DA2D0A9_1575528531094_Screen+Shot+2019-12-05+at+5.31.04+pm.png)
Required PPU (for this resolution) = 1125 / 10 = 112.5
Responsive game sizes
If you want to make a responsive game that works for multiple resolutions, you’ll have to decide on how you want to deal with the screen size changes. Say, if you have a bigger screen:
- Do you see more of the world?
- Does this significantly change the game play?
- Or is everything just enlarged?
- If everything is enlarged, then you have to make sure the resolution of your images is high enough to support your largest supported device.
To be continued…