1
\$\begingroup\$

I have a question about how scales work in Unity (using 5.0).

I've made a .gif image that is 100x100 pixels in size.

I put it in Resources folder under Assets.

When i drag it onto the scene it looks very tiny. Scale of it is x:1, y:1, z:1

I've added a 14 size font onto the scene as well for comparison.

You can see the little blue square underneath it.

I don't understand why the square is so small when it came from 100x100 pixel image and the text is only 14 px big.

Am i missing something really simple here?

enter image description here

\$\endgroup\$
  • \$\begingroup\$ By the way, "I don't understand why the square is so small when it came from 100x100 pixel image and the text is only 14 px big." The text is not 14px big, the text is 14 units big. Refer to my answer. \$\endgroup\$ – Zee May 20 '15 at 7:56
3
\$\begingroup\$

When importing sprites into Unity, you don't work with pixels anymore, you work with units.

By default, all sprites have : 100pixel per unit. 100px = 1 unit.

You can change this, go to your sprite in the assets, click it, and on the editor you'll see the "Pixels per Unit", which should indeed be 100. If you change it to 1, then every 1 pixel will equal 1 unit. Using units is much easier to keep track of everything, since both gameObjects and sprites have the same unit.

\$\endgroup\$
  • \$\begingroup\$ Is this ok to do? Adjusting the pixel per inch ratio? Is that bad practice or pretty standard practice to do. \$\endgroup\$ – Dust May 20 '15 at 22:42
  • \$\begingroup\$ It's "okay" to do. I generally prefer to change the sprite's scale rather than the ppu ratio. Since you obviously will always need to re-scale them in the editor. But if my sprites are for some reason all extremely small, then it's always good to change the ratio for all of them, so you can have an easier time working with them in the Editor. \$\endgroup\$ – Zee May 20 '15 at 22:49
  • \$\begingroup\$ Thanks for info, yes scale modification seems to work better for me too, rather then PPI adjusments \$\endgroup\$ – Dust May 20 '15 at 23:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.