E
E
Evgeny Ivanov2021-07-14 09:26:13
Unity
Evgeny Ivanov, 2021-07-14 09:26:13

What does Pixels Per Unit mean?

After uploading a sprite to Unity, there is an option in its settings called Pixels Per Unit.
60ee820bcc66f540738848.png
By default Pixels Per Unit=100.

I created a project with canvas. Placed on canvas Image. And pointed him to a sprite with Pixels Per Unit=100.
Everything works great.

Then I created an empty object outside of the canvas.
I added a Sprite Renderer to it and gave it a starting sprite (with Pixels Per Unit=100 by default).
The sprite didn't show up. And only after changing Pixels Per Unit=1 the sprite started to be displayed.

What does Pixels Per Unit mean? How does it affect display?
I thought it was enough just to upload a picture and that's it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
twobomb, 2021-07-14
@twobomb

100 pixels per unit would mean that a sprite that would be 100 pixels would be equal to 1 scene unit. It's just a scale showing how many pixels equal one unit. It can affect things like physics. Setting fewer unit pixels will take more effort to move one unit than setting higher unit pixels.
Yes, there may be times when you want to manipulate pixels by one. If you have a tile sheet that is 16x16 tiles, you might consider setting the number of pixels per unit to 16 so that you can easily join tiles together in a scene, for example.

F
freeExec, 2021-07-14
@freeExec

You have a cube in the world of 1 unit by 1 unit and by 1 unit. If you stretch a sprite on it, then only 100 pixels will fit on one face.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question