- Home /
Question about sprite size and camera size
Hi
I want to make a sprite that covers the whole screen. My camera size is 8. How do i know how big the size of the sprite must be to cover the whole screen?
Iv'e been trying to "test" how big the size must be by making a , lets say 3000x2000 image in Gimp and importing it to Unity. If its to small to cover the screen i make it bigger etc. This will take so much time to make it fit the whole screen perfectly.
There has to be and easy way?
Answer by Priyanshu · Mar 22, 2015 at 10:08 AM
If your image is 3000x2000. It means it covers 3000 pixels of screen width and 2000 pixels of screen height.
When you import an image in Unity. There is an option called 'Pixels per unit' in the import settings. Usually its set to 100.
That means 100 pixels of your image will cover 1 unit in Unity. 1 unit in Unity =
Distance between transform.position.x = 1 and transform.position.x = 2
If scale of Unity cube is 1 x 1 x 1. It covers 1 unity Unit in Length.width.height or Volume.
Now if you import image with resolution 3000x2000 in Unity and Pixels per Unity is set to 100. Your image will cover 30 Unity units in width and 20 Unity units in height.
Now about Camera:
Camera size is half of Camera height. If your Camera size is 8. Your Camera will cover 16 Unity units. To Cover 20 unit Height of your Image (Calculated above), Camera needs to be 20/2 = 10 units. Now your image will fill the camera in height.
Camera width is in proportion to resolution selected. If your resolution is 3000x2000 and your camera size is 10 i.e. your camera is covering 20 units in height (Calculated above). It will cover 30 units in width.
This answer was an attempt to clear the concept of image resolution, 'Pixels per unit' in the import settings, Camera size.
To solve your problem, you can either adjust the pixels to units number in the import settings as suggested by @BoredMormon or you can adjust Camera size or you can Altogether change the resolution of your image. Depends on what settings you want to keep and what settings you want to change.
Answer by Kiwasi · Mar 22, 2015 at 09:20 AM
The easier way is to adjust the pixels to units number in the import settings.
Your answer
![](https://koobas.hobune.stream/wayback/20220613190731im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Orthographic Camera Size? 3 Answers
Sprite facing multiple cameras? 1 Answer
Resolution, camera size and 3D game objects 0 Answers