- Home /
shown background size doesn't match scene size
This is my first Unity project, in 2D. I have a background image that has size 1024x768, and scene is set to 1024x768 as well, as it's intended for iPad. I would expect it to take fill up entire scene, but it doesn't, unless I set camera size to 3.84. What could go wrong?
Here are the settings that may be relevant:
Camera:
projection - orthographic
viewport - 0,0; 1x1
size - 1
position - 0,0,-10
scale - 1,1,1
Background:
texture type - sprite
pixels to units - 100
size - 1024x768
max size - 1024 everywhere
Answer by robertbu · May 14, 2014 at 12:03 AM
You have an orthographic camera. The orthographic size is 1/2 the screen height in world units. Your sprite has 100 pixels to a unit. So a image with a height of (1024x768) will be 10.24 x 7.68 world units in size. So with a vertical size of 7.68, the orthagraphic size to have that image vertically fill the scene is 7.68 / 2.0 = 3.84.
Your answer
Follow this Question
Related Questions
Best way to repeatedly tile small sprite? Sprite Manager? 2 Answers
Exporting for unity from illustrator 0 Answers
2D GAME (non UI object) for every pc resolution 0 Answers
How can I stop my endless runners background sprites from falling out of sync? 1 Answer
Parallax effect for background [C#] just a simple math error but I can't fix it 1 Answer